Sys.WebForms.Res未定义

The*_*dge 7 asp.net ajax webforms

  • .NET 4.51 Webforms
  • VS2013更新1

我从一个全新的Web项目开始,选择WebForms和MVC支持.在本地工作了几天没有问题.但是现在我在web上部署它我收到错误:

TypeError:Sys.WebForms.Res未定义

阅读其他帖子后,这似乎与ScriptManager等有关.以下是我的母版页脚本管理器块:

<asp:ScriptManager runat="server">
    <Scripts>
        <%--To learn more about bundling scripts in ScriptManager see http://go.microsoft.com/fwlink/?LinkID=301884 --%>
        <%--Framework Scripts--%>

        <%--<asp:ScriptReference Name="jquery" />--%>   
        <asp:ScriptReference Name="MsAjaxBundle" />
        <asp:ScriptReference Name="bootstrap" />
        <asp:ScriptReference Name="respond" />
        <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />      
        <%--Site Scripts--%>
    </Scripts>
</asp:ScriptManager>

<div class="container body-content">
    <asp:ContentPlaceHolder ID="cphMainWithoutUpdatePanel" runat="server"></asp:ContentPlaceHolder>
    <asp:UpdatePanel ID="updMain" runat="server">
        <ContentTemplate>
            <asp:ContentPlaceHolder ID="cphMain" runat="server"></asp:ContentPlaceHolder>
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
Run Code Online (Sandbox Code Playgroud)

我在头部声明了jQuery:

<script src="//code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>
Run Code Online (Sandbox Code Playgroud)

web.config中对AJAX的唯一引用:

  <appSettings>
    <add key="webpages:Version" value="3.0.0.0" />
    <add key="webpages:Enabled" value="false" />
    <add key="PreserveLoginUrl" value="true" />
    <add key="ClientValidationEnabled" value="true" />
    <add key="UnobtrusiveJavaScriptEnabled" value="true" />
  </appSettings>
     <system.web>
        <authentication mode="None" />
        <compilation targetFramework="4.5" />
        <httpRuntime targetFramework="4.5" />
        <pages>
          <namespaces>
            <add namespace="System.Web.Helpers" />
            <add namespace="System.Web.Mvc" />
            <add namespace="System.Web.Mvc.Ajax" />
            <add namespace="System.Web.Mvc.Html" />
            <add namespace="System.Web.Optimization" />
            <add namespace="System.Web.Routing" />
            <add namespace="System.Web.WebPages" />
            <add namespace="Microsoft.AspNet.Identity" />
          </namespaces>
        </pages>
Run Code Online (Sandbox Code Playgroud)

除了更新面板,我没有使用任何MS AJAX AFAIK.所以没有AjaxControlToolkit.我在页面中没有自定义JS调用.

因此,这一切都在本地工作,这让我相信远程服务器上的某些东西是不同的.然而,对于我的生活,我无法解决它.有没有人有任何建议?

真的需要得到这样的任何帮助或建议所以任何帮助或建议,无论多么快乐地收到.

The*_*dge 4

我最终解决了这个问题。就我而言,出现此问题的原因是在更新面板中发现的代码/控件中存在其他一些低级异常。

一旦纠正了上述错误,一切正常,Res 错误就消失了。现在,如果我遇到低级错误(例如 EF 问题或类似问题),错误就会再次出现。很烦人,但至少我知道它是什么以及如何处理它。