trouble with image

  • Thread starter Thread starter tjer
  • Start date Start date
T

tjer

Hi guys,

I'm a beginner of asp.net:( When I click a
(System.Web.UI.WebControls.)Button on a page,of course,its' click event has
been assigned,the images on this page should be refreshed,right?These
images' imageurl are such as "getpic.aspx?id=xxx".But refresh doesn't
happen,why?

Much thanx.
 
Presumably because the browser has cached the image that was at that
URL previously. If you want to load a different image for each screen
refresh then add a random number, or datestamp to the URL for your
image, that way the browser receives a different URL and will
redownload the image.
 
Flinky Wisty Pomm said:
Presumably because the browser has cached the image that was at that
URL previously. If you want to load a different image for each screen
refresh then add a random number, or datestamp to the URL for your
image, that way the browser receives a different URL and will
redownload the image.

For a production environment, where the image may not change much, then I
would recommend removing the auto-generated number so that the cache
displays the image. Otherwise, the client may download more than it needs
too....<shrug>

Mythran
 
Thanx for your advice.My current problem: in the button click event,picture
stored in db is changed. "GetPic.aspx?id=xxx" is used to get pic from
db.What I want is after click,the image on this page should display the new
content(reload from db).But now db has updated successfully,the page is
still here,no change.
 
"removing the auto-generated number so that the cache displays the image"

Sorry but I have no idea how to remove,thanx.
 
Much thanx,Flinky Wisty Pomm && Mythran:)

I got it,add a RequiredFieldValidator on the page and bind it to any
control,then nothing bother me:) But who can tell me why?puzzling
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top