本文介绍了单击“注销”按钮后禁用“浏览器后退”按钮功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在母版页中使用了以下代码

I used the below code in master page

<script type="text/javascript">
        function noBack()
         {
             window.history.forward()
         }
        noBack();
        window.onload = noBack;
        window.onpageshow = function(evt) { if (evt.persisted) noBack() }
        window.onunload = function() { void (0) }
    </script>



它对我有用,但我仍然有问题。

因为我在母版页中设置了注销操作,所以浏览器对于与母版页相关联的每个页面都禁用了后退按钮。这是因为,对与主页面关联的每个页面执行代码。

我需要在单击注销时禁用浏览器后退按钮功能。


It is working good for me, but still I have a problem.
As I have set the logout operation in a master page, the browser back button is disabled for every page associated with the master page.It is because,code is executed for every page associated with the master page.
I need to Disable Browser Back Button functionality only when logout is clicked.

推荐答案




这篇关于单击“注销”按钮后禁用“浏览器后退”按钮功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 23:06