C# 另一个ASP.net AJAX系统未定义错误

C# 另一个ASP.net AJAX系统未定义错误,c#,asp.net,javascript,ajax,C#,Asp.net,Javascript,Ajax,我在这里束手无策。我在VS2008中开发了一个ASP.NET2.0Web项目。这个问题发生在我的dev XP系统以及我们的windows2000和2008服务器上。 该项目使用AJAX 1,并参考System.Web.Extensions 1.0.61025.0和AJAXControlTookKit 1.0.10618.0 我正在尝试使用ScriptManager和ToolKitScriptManager控件来帮助嵌入javascript文件 在尝试嵌入之前,我必须消除可怕的SYS未定义java

我在这里束手无策。我在VS2008中开发了一个ASP.NET2.0Web项目。这个问题发生在我的dev XP系统以及我们的windows2000和2008服务器上。 该项目使用AJAX 1,并参考System.Web.Extensions 1.0.61025.0和AJAXControlTookKit 1.0.10618.0

我正在尝试使用ScriptManager和ToolKitScriptManager控件来帮助嵌入javascript文件

在尝试嵌入之前,我必须消除可怕的SYS未定义javascript错误。 实际上,如果我使用ScriptManager使用Path属性包含javascript文件,它就可以工作。SYS错误仍然存在,但是javascript文件包含在生成的页面中,并且可以正常工作。现在我正在处理一个只包含一些测试文本的空白页。此页面包装在包含空ScriptManager的母版页中

调试此页面时,Sys.WebForms.PageRequestManager上出现错误(请参阅下面生成的HTML)

我卸载并重新安装了AJAX,将System.Web.Extensions复制到我的bin,检查了我的Web.config设置至少50次&并且访问了如此多的搜索结果页面、论坛和博客,让我头晕目眩

我知道我可能忽略了一些简单的事情。下面是我的简略代码,有人能帮我想清楚这一点并抓住我所缺少的东西吗

谢谢

Web.config

<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>

  <appSettings>
    …
  </appSettings>

  <location path="PartnerPrograms">
    …
  </location>

  <system.web>
  <xhtmlConformance mode="Transitional" />
  <authentication mode="Forms">
     …
  </authentication>
  <trace enabled="false"/>
  <compilation debug="false">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
    </httpHandlers>

    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>

    <customErrors mode="Off">
    </customErrors>

    <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
    </pages>

    <siteMap defaultProvider="AspNetXmlSiteMapProvider">
      …
    </siteMap>

  </system.web>

  <system.web.extensions>
    <scripting>
      <webServices>
        <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
        <!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->
        <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
        <!--
        <authenticationService enabled="true" requireSSL = "true|false"/>
      -->

        <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
        <!--
      <profileService enabled="true"
                      readAccessProperties="propertyname1,propertyname2"
                      writeAccessProperties="propertyname1,propertyname2" />
      -->
      </webServices>
      <!--
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
    </scripting>
  </system.web.extensions>

  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules>
      <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </handlers>
  </system.webServer>
</configuration>

…
…
…
…
母版页


…
…
内容ASPX页面


您好,来自TestMaster.aspx
生成的HTML


无标题页
//
//
您好,来自TestMaster.aspx
//

我以前遇到过这个问题

在ajaxtoolkit中搜索嵌入的javascript文件,并查看其修改日期。 并确保不会在未来发生

为了确保这一点,请使用*.axd检查viewsource中出现的链接,并尝试运行每个人,如果您看到有人响应错误,请在此处找到问题所在


我的问候

我可能听起来很愚蠢,但仍然:Give我找到了*.axd,该怎么办?在我的例子中,它会导致HTTP状态代码500,但如何处理此信息?如果您发现某个文件响应500错误,并且在生成之前确定“ajaxtoolkit”中存在该文件,请尝试使用任何工具更改上次修改的日期,这意味着您在错误的未来日期生成dll。
<%@ Master Language="C#" AutoEventWireup="true" Codebehind="…" Inherits="…" %>
<!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">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    …
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager runat="server" ID="ScriptManager" />
…
    </form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="…" Inherits="…" MasterPageFile="…" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
    Hello from TestMaster.aspx
    </div>
</asp:Content>
<!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><title>
    Untitled Page
</title>
    <link href="App_Themes/GFYStyle/main-styles.css" type="text/css" rel="stylesheet" /><link href="App_Themes/GFYStyle/menu.css" type="text/css" rel="stylesheet" /></head>
<body>
    <form name="aspnetForm" method="post" action="testmaster.aspx" id="aspnetForm">
<div>
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwMDUyNjYzMjhkZA==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['aspnetForm'];
if (!theForm) {
    theForm = document.aspnetForm;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<script src="/WebResource.axd?d=_WiqftJEACb-AG_CJoE3Ow2&amp;t=633918597608321164" type="text/javascript"></script>


<script src="/ScriptResource.axd?d=ijkJL7RSAe839q84O1r7AVMBB0ct2fvAOK5xpjCeZxrwP0ygLeMB_n15PEMyX4_bqkpJiL-kZfiCFgkZo8QpQuTDwrSUkIcLrOxl8UfjJBc1&amp;t=633921693043429658" type="text/javascript"></script>
<script src="/ScriptResource.axd?d=ijkJL7RSAe839q84O1r7AVMBB0ct2fvAOK5xpjCeZxrwP0ygLeMB_n15PEMyX4_bqkpJiL-kZfiCFgkZo8QpQjLl6r3RCBV1yA4P_b8fb641&amp;t=633921693043429658" type="text/javascript"></script>
    <script type="text/javascript">
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
//]]>
</script>

    <div>

    <div>
    Hello from TestMaster.aspx
    </div>

    </div>


<script type="text/javascript">
//<![CDATA[
Sys.Application.initialize();
//]]>
</script>
</form>
</body>
</html>