ASP .NET C#中是否有任何浏览器后退按钮事件? [英] Is there any browser back button event in ASP .NET C#?

查看:85
本文介绍了ASP .NET C#中是否有任何浏览器后退按钮事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个页面,用户可以填写信息。填写信息后,用户可以点击按钮。当用户点击按钮时,我修改文本框的值并重定向到下一页。但是假设用户点击浏览器按钮,能看到修改后的值。我不想那样。在asp.net中是否有浏览器后退按钮的事件?所以我可以在那个事件中再次更改文本框值?



我尝试过:



尚未尝试过。我对此一无所知。

I have one page,user can fill info into that.After filling info, user can click on button.When user click on button,I am modifing textbox's value and redirecting to next page.But suppose user click on browser button,able to see modified value.I don't want to like that.Is there any event for browser back button in asp.net?So I can change textbox value again in that event?

What I have tried:

Not tried yet.I don't have any idea about it.

推荐答案

无法知道用户是回去了还是阻止他们这样做。你的网站的行为是正常的,人们期望...如果你回去你看到上一页,对吗?



确保旧数据的唯一方法是显示的是禁用该页面上的缓存。如果你谷歌asp.net禁用缓存你会发现你可以放在page_load中的代码片段,让你这样做。但是,如果您没有任何好处,那么您会对网站的性能产生负面影响,并且会以一种可能会惹恼您用户的方式。
There is no way of knowing if users have gone back, or stopping them from doing so. The behaviour of your site is normal and what people expect...if you go back you see the previous page, right?

The only way of ensuring old data isn't shown is to disable caching on that page. If you google "asp.net disable caching" you'll find code snippets you can place in page_load that let you do that. However you are negatively impacting the performance of your site for no benefit, and in a way that will probably annoy your users.


这篇关于ASP .NET C#中是否有任何浏览器后退按钮事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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