Thursday, March 22, 2012

trouble with image

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" <Pathogenix@.gmail.com> wrote in message
news:1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> 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.
"Flinky Wisty Pomm" <Pathogenix@.gmail.com>
':1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> 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.
>
"removing the auto-generated number so that the cache displays the image"
Sorry but I have no idea how to remove,thanx.
"Mythran" <kip_potter@.hotmail.comREMOVETRAIL>
':eeIMsezVGHA.5044@.TK2MSFTNGP09.phx.gbl...
> "Flinky Wisty Pomm" <Pathogenix@.gmail.com> wrote in message
> news:1144079199.958679.87150@.v46g2000cwv.googlegroups.com...
> 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
>
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
"tjer" <tj@.tj.edu.cn> ะด?:#jIoo1xVGHA.5288@.TK2MSFTNGP14.phx.gbl...
> 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.
>

0 comments:

Post a Comment