Entire page do postback wehn swapping image, problem

  • Thread starter Thread starter Jeff
  • Start date Start date
J

Jeff

hi

asp.net 2.0

I have a Image control on my Default.aspx page, under the image control
there are 2 buttonlinks (previous, next), so when clicking on those 2
buttons the image control displays another picture..

the problem is that when I do this image swap the entire page is
refreshed/updated... instead I want only the image to refresh..

how I do that? Need I upgrade to asp.net 3.5 and utilize UpdatePanel or is
there some tricks in asp.net 2.0 I can use?

any ideas?
 
Hello Jeff,
hi

asp.net 2.0

I have a Image control on my Default.aspx page, under the image
control there are 2 buttonlinks (previous, next), so when clicking on
those 2 buttons the image control displays another picture..

the problem is that when I do this image swap the entire page is
refreshed/updated... instead I want only the image to refresh..

how I do that? Need I upgrade to asp.net 3.5 and utilize UpdatePanel
or is there some tricks in asp.net 2.0 I can use?

any ideas?

I used to write that in Javascript back in 1998 withou any problems. You
can also do it with AJAX and UpdatePanels, but there really is no need.

A sample can be found here:
http://www.devx.com/tips/Tip/13653

You just need to set the src of the image to a new URL. So if you know the
url, or can place a list of urls in a javascript array, you can do this without
ever needing to post back at all.
 
Back
Top