简体   繁体   English

如何在GridView中更新照片

[英]How to update photo in gridview

I have a gridview with employees name, there is link to another page,with employee information,when the user click on the link, according to employee id get the employee information from database, in this page we can add photos or update them,which works fine, 我有一个带有员工姓名的gridview,有另一个页面的链接,其中包含员工信息,当用户单击链接时,根据员工ID从数据库中获取员工信息,在此页面中我们可以添加照片或更新它们,工作正常,

the problem is when updating the photo, and click the link, I see the same photo not the updates one,until I refresh the browser, 问题是在更新照片时,单击链接,我看到的是同一张照片而不是更新的照片,直到刷新浏览器,

what is the solution for this? 解决方案是什么?

Thanks in advance, 提前致谢,

It seem sto be a cache problem. 似乎是缓存问题。 try to send a random param in the url to the next page where you see the Employees. 尝试将url中的随机参数发送到下一个您看到“员工”的页面。 Or try to put in the page where you see the employee information 或者尝试在您看到员工信息的页面中放置

Response.Cache.SetCacheability(HttpCacheability.No Cache)
Response.Cache.SetExpires(Now())
Response.AddHeader( "Pragma", "no-cache")

Hope it works 希望能奏效

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM