我正在开发一个 ASP.NET 应用程序。我想阻止用户在退出应用程序后使用浏览器中的后退按钮查看上一页。
最佳答案
感谢您的所有回复。
代码:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));
Response.Cache.SetNoStore();
Response.AppendHeader("Pragma", "no-cache");
我在页面加载事件中使用了此代码。它的工作正常。
关于asp.net - 从应用程序注销后,防止浏览器中的后退选项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1629656/