NetProgrammingHelp.com
Asp.Net,C#,Ajax,Sql server,silverlight,Javascript codes exambles articles,Programming exambles

Recent Posts

  • How to declare/use global constants (enum’s) in javascript ajax function
  • Silverlight Data Binding OneWay TwoWay Asp.Net C# XAML
  • Accessing Executing Running Stored Procedure/Function/Package Using Linq Silverlight Xaml
  • Creating/Developing Silverlight Data Driven Applications Using Wcf Linq Asp.Net C#
  • Deploying Manually Publish XBAP Wpf Browser Application in IIS Asp.Net C# XAML
  • Creating Server and client using remoting asp.net c#
  • Create/Build wcf autocomplete/autoextender textbox using database linq c# asp.net
  • Essentials for Creating/Developing/Programming silverlight project tools wpf xaml
  • Working with xml data type variable sql server 2008 asp.net c#
  • Encrypting Stored Procedure sql server 2008 asp.net c#
  • Disable Avoid Browser Back Button Functionality Using JavaScript Asp.Net

    Posted by James Categorized Under: ASP.NET 2 Comments

    Introduction:
    In this article i am going to explain about how to disable avoid browser back button functionality using javascript asp.net.

    Main:

    We can easily avoid the navigation of previous page(using browser back button) using the below simple script,

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

    If you wants in Code Behind,

    string local_exestring = "&lt;SCRIPT language=javascript&gt;n";
    local_exestring += "window.history.forward(1);n";
    local_exestring += "n";
    <strong>ClientScript.RegisterClientScriptBlock(this.Page.GetType(), "Script",local_exestring );</strong>

    Conclusion:
    Hope this helps,
    Happy Coding.

    2 Responses to “Disable Avoid Browser Back Button Functionality Using JavaScript Asp.Net ”

    1. [...] Follow this link: Disable Avoid Browser Back Button Functionality Using JavaScript … [...]

    2. Great blog! I really love how it’s easy on my eyes and the details are well written. I am wondering how I could be notified whenever a new post has been made. I have subscribed to your rss feed which must do the trick! Have a nice day!

    Leave a Reply