开发者

have problem in image control c#.net

开发者 https://www.devze.com 2023-03-03 01:45 出处:网络
Hi ihave a problem with my image control that is when i upload an image it shows that image but when i update it, its shows old image while updates in data base i think it gets image from cache is the

Hi i have a problem with my image control that is when i upload an image it shows that image but when i update it, its shows old image while updates in data base i think it gets image from cache is there a开发者_StackOverflow中文版ny technique to handle this issue kindly tell me.

Image1.ImageUrl = populatedata.ResultSet.Tables[0].Rows[0][12].ToString();
string file_ext = Path.GetFileName(Image1.ImageUrl);
Image1.ImageUrl = "~/EmpImages/" + file_ext;

thanks


From looking at your code sample. I don't understand why you are setting your Image1.ImageUrl twice?

I don't think it could be a caching issue. What you need to do make a call to the database (rebind) to retrieve the new image url after a new image upload has happened.

0

精彩评论

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