Click here to Skip to main content
15,889,497 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In .aspx page i created one javascript function create like this

XML
<%@ Page Title="" Language="C#" MasterPageFile="~/Menu.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="LoupeMain.WebForm1" %>


<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

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

    </script>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>




In .aspx.cs page i write like this code



C#
protected void Page_Load(object sender, EventArgs e)
        {

            Response.AppendHeader("Refresh", Convert.ToString(((HttpContext.Current.Session.Timeout * 60) - 5)) + "; Url=" + "WebForm3.aspx");

        }


when after navigate the page the backward button of browser is not working
Why here javascript function is not working



Please give any suggetions for me
Posted

1 solution

Take an html page and check if the following code is working or not.

JavaScript
function disableBackButton() {
        window.history.forward();
    }
    setTimeout("disableBackButton()", 0);
    window.onunload = function () { null };
 
Share this answer
 
Comments
krish2013 14-Aug-13 7:07am    
Hi Deviprasad,
It's working fine in html page.with master page webform this javascript function is not working Please give any solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900