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

    Is there any browser back button event in ASP .NET C#?

    I have one page,user can fill info into that.After filling info, user can click on button.When user click on button,I am modifing textbox's value and redirecting to next page.But suppose user click on browser button,able to see modified value.I don't want to like that.Is there any event for browser back button in asp.net?So I can change textbox value again in that event?
  • #765339
    You can not disable browser back button but you can make it BLOCK, basically One cannot disable the browser back button functionality only thing that can be done is prevent them.

    Below JavaScript code needs to be placed in the head section of the page where you don't want the user to revisit using the back button:

    <script>
    function preventBack(){window.history.forward();}
    setTimeout("preventBack()", 0);
    window.onunload=function(){null};
    </script>

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #765349
    In which event I have to call above javascript function?


Sign In to post your comments