页面丢失的历史记录 [英] lost prevous history of page

查看:66
本文介绍了页面丢失的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击浏览器后退按钮时,我以前的页面历史记录将丢失.单击浏览器后退按钮时,我不希望刷新页面.请给我解决方案

When I click browser back button my previous page history is lost. I don’t want page refreshed when I click browser back button. Please give me solutions

推荐答案

它不能那样工作.请记住,网络是无状态的,当您导航到某个页面时,浏览器并不知道您是第一次还是第14次访问该页面. ASP.NET通过设置viewstate来处理回发,但是一旦离开页面,该页面的viewstate就会被破坏.单击后退按钮就像是第一次访问该页面.
It doesn''t work that way. Remember, the web is stateless, when you navigate to a page the browser doesn''t know if its the first time or 14th time you have visited the page. ASP.NET handles postbacks by setting the viewstate but once you navigate away from the page then viewstate for that page is destroyed. Clicking the back button is like visiting the page for the first time again.


如果单击浏览器的后退按钮,则最终页面循环将再次运行.因此,如果您不维护视图状态或会话值,那么它将确定删除所有先前的值.
If you click the browser back button then ultimately page cycle runs again. So if you didn''t maintain the view state or session value then it will delete all previous value for sure.




如果单击后退按钮,则可以在该循环中编写if(ISPostback),可以使用querystring或任何其他cookie编写检索代码.
如果是回发,则表示该页面将被回发一次,但是该按钮包含上一页数据.



您可以使用ajax控件,它会部分回发页面,您的内容无法销毁,只能更新更改的内容.
Hi,

If you click the back button,in that button you can write if(ISPostback) in that loop you can write the retrieving code by using querystring or any other cookies.
If is post back means the page will be post backed once but the button contains previous page data.

Or

You can use ajax controls,it is partially postbacked the page,your content cannot be destroyed,only changed content can be updated.


这篇关于页面丢失的历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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