Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sys.WebForms.Res is undefined

  • .NET 4.51 Webforms
  • VS2013 Update 1

I started with a brand new Web project selecting both WebForms and MVC support. Been working on it for a couple of days locally with no problem. However now that I web deploy it I am getting the error:

TypeError: Sys.WebForms.Res is undefined

Having read other posts it appears this has something to do with ScriptManager etc. So below is my master page script manager block:

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

I have jQuery declared in the head as:

<script src="//code.jquery.com/jquery-1.11.0.min.js" type="text/javascript"></script>

The only reference to AJAX in the web.config:

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

Aside from the update panel I am not using anything MS AJAX AFAIK. So no AjaxControlToolkit. I have no custom JS calls in the page.

So as this all works locally it leads me to believe that something is different on the remote server. However for the life of me I cannot work it out. Has anyone got any suggestions?

Really need to get this live so any help or suggestion no matter how far fetched happily received.

like image 365
TheEdge Avatar asked Mar 16 '14 09:03

TheEdge


1 Answers

I ended up solving this. In my case this issue arose because there was some other low level exception within code/controls that were found within an update panel.

Once the above error was corrected everything worked the Res error went away. Now if I have a low level error such as EF problem or similair the error comes back. Annoying but at least I know what it is and how to deal with it.

like image 124
TheEdge Avatar answered Sep 19 '22 03:09

TheEdge