如何处理浏览器后退按钮? [英] How to handle browser back button ?

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

问题描述



我有一个页面让我们说User.aspx。它显示网格上的所有用户。在单击视图列的行中,会出现一个显示用户详细信息的弹出窗口。现在关闭弹出窗口并直接转到另一个页面。让我们说CompanyDetails.aspx。现在单击浏览器后退按钮服务器显示为页面重定向到用户详细信息页面而不是用户页面(User.aspx)。如何在不打开弹出窗口的情况下直接转到(User.aspx)。



非常感谢提前。

Hi
I had a page lets say User.aspx. It shows all users on a grid.On clicking view column a a row , a pop up appear that display user details. Now close the pop up and go to another page directly. Lets say CompanyDetails.aspx. Now on clicking browser back button server appear as page redirect to user details page not user page(User.aspx).How can I directly go to (User.aspx) without opening the pop up.

Many many thanks in advance.

推荐答案

hi,



试试这个,

尝试从浏览器中删除以前的历史...



http://www.ehow.com/how_7512704_delete-history-aspnet.html [ ^ ]


我建​​议不要尝试处理后退按钮如何在用户页面上显示弹出窗口。尝试使用该弹出窗口的ajax请求。
Rather than trying to handle the back button, I would suggest working around with how you display the popup on the user page. try using an ajax request for that popup.


我是通过在结尾添加history.back()来实现的。以前它是





window.open(''ABC.aspx''',''TEST'',''width = 800,height = 700,scrollbars = yes,resizable = yes,status =不,工具栏=否,位置=否,顶部= 45,左= 45'');;



将其更改为

window.open(''ABC.aspx'',''TEST'',''width = 800,height = 700,scrollbars = yes,resizable = yes,status = no,toolbar = no,location = no, top = 45,left = 45''); history.back();;
I did it by adding history.back() at end .Previously it was


"window.open(''ABC.aspx"'', ''TEST'', ''width=800, height=700, scrollbars=yes,resizable=yes, status=no, toolbar=no, location=no, top=45, left=45'');";

changed it to
"window.open(''ABC.aspx"'', ''TEST'', ''width=800, height=700, scrollbars=yes,resizable=yes, status=no, toolbar=no, location=no, top=45, left=45'');history.back();";


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

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