asp.net Web应用程序中的注销问题 [英] logout problem in asp.net web application
本文介绍了asp.net Web应用程序中的注销问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我按下退格按钮时,尽管我已经结束了会话
when i press backspace button my admin page opens in spite i have ended the session
推荐答案
浏览器缓存的思考,但我的管理页面仍会打开.如果您担心,则需要使用一些javascript代码清除后退按钮功能.
Think of the browser cache. If you are concerned then you need to clear the back button functionality using some javascript code.
<script language="JavaScript">
window.history.forward(1);
</script>
您可以通过JavaScript清除浏览器历史记录....
You can clear browser history through JavaScript....
//clears browser history and redirects url
<SCRIPT LANGUAGE=javascript> { var Backlen=history.length; history.go(-Backlen); window.location.href=page url }</SCRIPT>
或
OR
Page.ClientScript.RegisterStartupScript(this.GetType(),"cle","windows.history.clear",true);
或者如您在登出事件中所说:
OR as you say in you logout event:
protected void LogOut()
{
Session.Abandon();
string nextpage = "Logoutt.aspx";
Response.Write("<script language=javascript>");
Response.Write("{");
Response.Write(" var Backlen=history.length;");
Response.Write(" history.go(-Backlen);");
Response.Write(" window.location.href='" + nextpage + "'; ");
Response.Write("}");
Response.Write("</script>");
}
非常感谢.你不知道你是如何解决我的问题的.非常感谢
Thank you very much. You dont know how you have solved my problem. Thank you very much
这篇关于asp.net Web应用程序中的注销问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文