ASP .NET C#中是否有任何浏览器后退按钮事件?

编程入门 行业动态 更新时间:2024-10-09 09:22:33
本文介绍了ASP .NET C#中是否有任何浏览器后退按钮事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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?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禁用缓存你会发现你可以放在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 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#中是否有任何浏览器后退按钮事件?

本文发布于:2023-11-29 06:04:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1645553.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:按钮   有任何   浏览器   事件   ASP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!