开发者

Requesting image from filestream cross-browser issue

开发者 https://www.devze.com 2023-04-11 20:06 出处:网络
I use a ajax upload system to uploading image to the filestream in .NET. At the beginning I use a default picture with the url (For example: http://localhost/test/tempimage/dfa7294514b748db95a9dd101.

I use a ajax upload system to uploading image to the filestream in .NET. At the beginning I use a default picture with the url (For example: http://localhost/test/tempimage/dfa7294514b748db95a9dd101. This request is processed by my handler and put a default image for it if a specified session is null.

After I uploaded a new image I change part of html of the page by jquery without postback the page. The problem is the开发者_如何学运维 url is same like above but actually refers to different image in the filestream. But browsers except chrome doesnt request the image source again. So the user still see the default image.

So how can I provide requesting the image again when I change the html of the page ? I am looking for a effecient way. Not changing url per upload for example.

Thanks for interest,


You should disable caching in your image handler

Response.Cache.SetCacheability(HttpCacheability.NoCache);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号