Tuesday, 3 December 2013

Disable Backbutton in asp.net

Copy to This code and Paste in the sourcecode Head section  or  within content placeholder :-

  <script type="text/javascript" language="javascript">

    function DisableBackButton() {

        window.history.forward()

    }
    DisableBackButton();
window.onload = DisableBackButton;

    window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }

    window.onunload = function () { void (0) }

</script>



 <%--<title>Disable Browser Back buttons</title>--%>

<script type="text/javascript" language="javascript">

    function DisableBackButton() {

        window.history.forward()

    }

    DisableBackButton();

    window.onload = DisableBackButton;

    window.onpageshow = function (evt) { if (evt.persisted) DisableBackButton() }

    window.onunload = function () { void (0) }

</script>

No comments:

Post a Comment