开发者

AJAX tags giving error: Sys is undefined

开发者 https://www.devze.com 2023-04-12 06:22 出处:网络
Below is the code of my Master Page. When I enable ScriptManager and related tags (as shown below), IE generates error: Sys is undefined while debugging. When I disable AJAX, the error is not shown. T

Below is the code of my Master Page. When I enable ScriptManager and related tags (as shown below), IE generates error: Sys is undefined while debugging. When I disable AJAX, the error is not shown. The page and related code is working properly irrespective of the error shown or not shown.

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>

    <!-- Project CSS attachments -->
    <link href="Stylesheets/StyleSheet2.css" rel="stylesheet" type="text/css" />
    <link href="Stylesheets/ReportsMenu.css" type="text/css" rel="Stylesheet" />
    <link href="Stylesheets/StyleSheet.css" rel="stylesheet" type="text/css" />
    <link href="Stylesheets/TubewellReportsMenu.css" rel="stylesheet" type="text/css" />

    <!-- JQuery Core attachment -->
    <link href="Resources/JQueryScripts/Core/jquery-1.6.4.min.js" type="text/javascript" />    
    <link href="Resources/JQueryScripts/Core/jquery.min.js" type="text/javascript" />

    <!-- JQuery MSG Plugin library attachments -->
    <link href="Resources/JQueryScripts/MsgPlugin/jquery.center.min.js" type="text/javascript" />    
    <link href="Resources/JQueryScripts/MsgPlugin/jquery.msg.js" type="text/javascript" /> 
    <link href="Resources/JQueryScripts/MsgPlugin/jquery.msg.min.js" type="text/javascript" />
    <link href="Resources/JQueryScripts/MsgPlugin/jquery.msg.css" rel="Stylesheet" type="text/css" />                   

    <!-- JQuery Message Box Library attachments -->
    <link href="Resources/JQueryScripts/MsgBox/jquery.dragndrop.min.js" type="text/javascript" />            
    <link href="Resources/JQueryScripts/MsgBox/jquery.msgbox.js" type="text/javascript" />            
    <link href="Resources/JQueryScripts/MsgBox/jquery.msgbox.css" type="text/javascript" />            
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <div runat="server">
            <div class="TopBand" runat="server">
                <asp:LinkButton ID="LinkButton1" runat="server" PostBackUrl="~/Default.aspx" >Home</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lbAdministration" runat="server" PostBackUrl="~/Admin.aspx" >Administration</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="LinkButton2" runat="server" PostBackUrl="~/pheTubewellFiles/contentReportTubewellMenu.aspx">Tubewell Reports</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;                
                <asp:LinkButton ID="lbReports" runat="server" PostBackUrl="~/pheSchemeFiles/contentReportSchemesMenu.aspx">Scheme Reports</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:LinkButton ID="lbRegister" runat="server" PostBackUrl="~/pheSchemeFiles/contentReportAllSchemeTypes.aspx">Register</asp:LinkButton>&nbsp;&nbsp;&nbsp;&nbsp;
            </div>

            <div id="divContentPlaceHolder" runat="server" class="ContentPlaceHolder">
                <asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
      开发者_StackOverflow中文版          </asp:contentplaceholder>
            </div>
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>

The error shown at run-time in IE debugger is this:

AJAX tags giving error: Sys is undefined

Why is ScriptManager and related AJAX tags giving this error?


You are using <link> tags to include javascript files. They should be included like this:

<script type="text/javascript" src="script.js"></script>

You also have one of your last <link> tags importing a css file but its type set to javascript:

<link href="Resources/JQueryScripts/MsgBox/jquery.msgbox.css" type="text/javascript" />

Solve these problems and maybe the rest will work?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号