且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除页面的缓存

更新时间:2023-12-01 23:15:46

在这些方面可能还会更多....?

用户1和用户2都希望处理同一条记录

*用户1进入页面并开始更改数据.
*在用户1提交任何更改之前,用户2也进入页面并开始修改数据
*用户1提交更改,更新数据库记录.
*用户2此时*并不知道记录已被更新*.
*用户2提交更改.当用户1和用户名1更改为用户2时,用户2的值将覆盖用户1的更改. 2都开始在页面上工作,并且用户2进行了任何更改.

这是一个并发问题,而不是一个缓存问题,有很多不同的处理方式.通读其中一些链接或Google

http://www.codeguru.com /csharp/.net/net_data/article.php/c19655/Handling-Concurrency-Issues-in-NET.htm [ http://msdn.microsoft.com/en-us/magazine/cc163924.aspx [ ^ ]
Could it be more along these lines....?

User 1 and User 2 both want to work on the same record

* User 1 enters the page and begins changing data.
* Before User 1 has submitted any changes, User 2 also enters the page and starts amending data
* User 1 submits changes, updating the database record.
* User 2 at this point *is unaware that the record has been updated*.
* User 2 submits changes. User 2 will overwrite Users 1''s changes with whatever the values were when Users 1 & 2 both started working on the page, and whatever changes User 2 made.

This is a concurrency issue rather than a caching issue, there are lots of different ways of handling this. Have a read through some of these links, or Google

http://www.codeguru.com/csharp/.net/net_data/article.php/c19655/Handling-Concurrency-Issues-in-NET.htm[^]

http://msdn.microsoft.com/en-us/magazine/cc163924.aspx[^]


Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);


将此代码放在母版页中.
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();
Response.Cache.SetExpires(DateTime.MinValue);


put this code in master page.