母版页中的javascript问题 [英] javascript issue in master page

查看:94
本文介绍了母版页中的javascript问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.aspx页面中,我创建了一个javascript函数,就像这样创建



In .aspx page i created one javascript function create like this

<%@ 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>









在.aspx.cs页面中,我写这个代码











In .aspx.cs page i write like this code



protected void Page_Load(object sender, EventArgs e)
        {

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

        }





导航页面后浏览器的后退按钮不起作用

为什么这里有javascript函数不工作







请为我提供任何建议



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

推荐答案

获取一个html页面并检查以下代码是否正常工作。



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

function disableBackButton() {
        window.history.forward();
    }
    setTimeout("disableBackButton()", 0);
    window.onunload = function () { null };


这篇关于母版页中的javascript问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆