Question

I have website (C#, ASP.NET, .NET 4.0) and using ASP.NET Ajax (Update Panel) and jQuery Ajax.

On client side, everything is ok and there is no any error...

After publish the website on the host, jQuery ajax work fine but update panel does not work and make postback and page refresh!

the .NET setting of host is .NET 4.0 too.

i dont know where is the problem and why?

Was it helpful?

Solution

The error on client was:

SCRIPT5022: ASP.NET Ajax client-side framework failed to load.

SCRIPT5009: 'Sys' is undefined

After many time to mining the websites, and more solutions, i solve the problem:

the solution for .NET 4.0 is:

Set EnableCdn property of script manager to true :) Like this:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnableCdn="true">

Next Solution and Better Solution is:

add this handler to your web.config

  <system.webServer>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated"/>
      <remove name="ScriptHandlerFactory"/>
      <remove name="ScriptHandlerFactoryAppServices"/>
      <remove name="ScriptResource"/>
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.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=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </handlers>
  </system.webServer>

OTHER TIPS

I suggest you to check whether all the ajax libraries are copied to the publish folder

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top