在不重新发送信息的情况下无法刷新页面 [英] The page cannot be refreshed without resending the information

查看:73
本文介绍了在不重新发送信息的情况下无法刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




当我刷新aspx页面时会得到

---------------------------
Microsoft Internet Explorer
---------------------------
如果不重新发送信息,则无法刷新页面.
单击重试"再次发送信息,
或单击取消"返回到您要查看的页面.
---------------------------
重试取消
---------------------------

像此消息框一样,我如何通过代码发送取消消息或如何避免此消息框




while i''m refreshing aspx page will get

---------------------------
Microsoft Internet Explorer
---------------------------
The page cannot be refreshed without resending the information.
Click Retry to send the information again,
or click Cancel to return to the page that you were trying to view.
---------------------------
Retry Cancel
---------------------------

like this message box how i can send cancel via code or how i can avoid this message box

推荐答案

刷新页面时,您以前执行过POST操作而不是GET.

提示您必须重新执行POST才能刷新页面,需要再次将数据发送到服务器以检索结果.

这是设计使然和预期的行为. Y
When you''re refreshing the page, you have previously performed a POST operation rather than a GET.

You are being told that you cannot refresh the page without performing the POST again, you need to send the data to the server again to retrieve the results.

It''s by design and expected behaviour. Y


如果编写避免缓存的代码,浏览器将强制刷新

如果您在page_load方法中添加以下代码,则可以避免页面被缓存

Browser forces refresh if you write the code for avoiding caching

if you add below code in your page_load method, it avoids cahing of the page

Response.Cache.SetCacheability(HttpCacheability.NoCache);
       Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
       Response.Cache.SetNoStore();



当您单击刷新按钮时,浏览器将查找缓存的页面,但是如果您有意避免缓存,则它将从服务器获取副本.

如果您使用NoCache逻辑,则删除该代码可能会对您有所帮助.



when you hit refresh button browser looks for cached page, but if you intentionally avoid caching, then it will take the copy from server.

if you used NoCache logic, removing that code may help you.


这篇关于在不重新发送信息的情况下无法刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆