如何使用来控制浏览器的按钮 [英] How to control browser's button using

查看:83
本文介绍了如何使用来控制浏览器的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我是.net的新手,
所以任何人都可以指导我如何清除缓存........
用户注销时需要它....
bcoz wen用户注销,他无法使用浏览器后退按钮来完成他的访问……..
所以请帮我.........
尽快

Hello frnds,
I m new at .net,
so can anybody guide me how to clear cache........
i need it when user log out....
bcoz wen user logout, he cant be achieved his accoung using browsers back-forward button........
so plz help me.........
as soon as possible

推荐答案

已被询问过多次.

发生这种情况是由于缓存.

1.清除会话
2.清除缓存,使浏览器没有历史记录(这将使浏览器中的后退/前进"按钮变为灰色).

清除缓存的代码可以放在后面的代码中,如下所示:
This has been asked number of times.

This happens because of cache.

1. clear the sessions
2. clear the cache such that browser has no history (this will make back/forward button in browser grayed out disabled.)

code for clearing cache can be put up in code behind as follows:
// 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格式:



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" />


这篇关于如何使用来控制浏览器的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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