You must Sign In to post a response.
  • Category: ASP.NET

    Disable ie back button in javascript

    disable ie7 back button in javascript
  • #657079
    try this
    Just put this javascript on the html section of aspx page above head section

    <script type = "text/javascript" >
    function disableBackButton()
    {
    window.history.forward();
    }
    setTimeout("disableBackButton()", 0);
    </script>

    on body
    <body onload="disableBackButton()">


    hope this will help you

  • #657085
    Write the code in body onload itself not in a JavaScript function. Use one of the following code:


    <body onload="window.history.forward()">


    or,


    <body onload="history.go(1);">


    Thanks & Regards
    Paritosh Mohapatra
    Microsoft MVP (ASP.Net/IIS)
    DotNetSpider MVM

  • #657117
    Please check this Javascript for disabling back button


    <script language="javascript" type="text/javascript">
    window.history.forward(-1);
    </script>

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM

  • #657168
    Put below code within <head>..</head> section.

    <script language="javascript">
    window.history.forward();
    </script>

    Thanks,
    Kundan

  • #657236
    Use below code under head section in all your aspx page or write in separate .js file call in all page


    <script language="JavaScript" type="text/javascript">
    window.history.forward();
    </script>

    Regards
    N.Ravindran
    Your Hard work never fails

  • #657347
    change your body tag like this

    <body onload="window.history.forward()">



    Thanks & Regards
    G.Renganathan
    Nothing is mine ,Everything is yours!!!


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.