注销按钮代码 [英] Log out button code

查看:66
本文介绍了注销按钮代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对登出按钮的asp代码有疑问。



点击退出按钮后,它会被正确地重定向到login.aspx页面

但是当我按下浏览器中的后退按钮时,它会再次返回登录页面。



为什么会发生这种情况?

可以做些什么来解决这个问题。?



我尝试过:



我找到的代码是这个



i have a doubt regarding logout button's asp code.

on clicking the logout button, it gets redirected correctly to login.aspx page
but when i press the back button in the browser,it again goes back to the logged in page.

why does this happen?
what can be done to solve this.?

What I have tried:

The code i found is this

<pre lang="c#">Session.Clear();
        Session.Abandon();
        Response.Redirect("Login.aspx");





以及此代码在Login.aspx.cs页面中页面加载事件方法





and also this code in Login.aspx.cs page in the page load event method

Response.Cache.SetNoStore();

推荐答案

检查这些

退出后的浏览器后退按钮问题 [ ^ ]

注销后的asp后退按钮问题 [ ^ ]
check these
Browser Back Button Issue After Logout [^]
asp back button issue after logout[^]


这篇关于注销按钮代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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