退出后阻止页面评论 [英] Prevent page reviews after logout

查看:61
本文介绍了退出后阻止页面评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在注销按钮的单击事件上使用以下代码注销:

Hi,

I am loging out using the following code on click event of logout button:

FormsAuthentication.SignOut();
Session.Abandon();
Response.Redirect("Home.aspx");



注销后,当我单击后退"按钮或将先前的URL粘贴到地址栏中时,页面就会加载.

如何在不禁用后退按钮的情况下防止这种情况.



Page gets load when i click on back button or paste the previous url in address bar After logout.

How prevent this without disable the back button.

推荐答案

可能是,当您单击后退按钮时,页面来自缓存.

如果是这样,则需要在该页面上禁用页面输出缓存.您可以尝试以下方法:

在aspx标记中

Chances are that when you click the back button the page is coming from cache.

If that is so, you need to disable page output cache on that page. You can try out these:

In aspx Markup

<%@ OutputCache Duration="0" VaryByParam="none" %>



或者,在CodeBehind



Or, in CodeBehind

Response.Cache.SetCacheability(HttpCacheability.NoCache);


此Trip/Trick会清除所有内容...精细.

注销后浏览器后退按钮问题 [
This Trip/Trick will clear everything...Fine one.

Browser back button issue after logout[^]


在此处尝试此链接,基本上添加了一些缓存指令

http://www.extremeexperts.com/Net/FAQ/DisablingBackButton.aspx [ ^ ]
Try this link here, basically adding some cache directives

http://www.extremeexperts.com/Net/FAQ/DisablingBackButton.aspx[^]


这篇关于退出后阻止页面评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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