关闭浏览器历史记录

关闭浏览器历史记录

本文介绍了关闭浏览器历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何关闭浏览器histry.当我注销时.会话将关闭.但是再次单击后退"按钮返回.

how to close the browser histry.when i log out.session will be closed.but click the back button again go to back.

推荐答案

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


// Code disables caching by browser. Hence the back browser button
// grayed out and could not causes the Page_Load event to fire 
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
Response.Cache.SetNoStore();





您可以将类似的东西添加为aspx格式:



OR

You can add somethin similar in form aspx if you want to place it there:

<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0"></meta></meta></meta>





您可以通过JavaScript清除浏览器历史记录....



OR

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);


这篇关于关闭浏览器历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 01:27