Monday, 1 April 2013

ASP.NET Ajax client-side framework failed to load And\Or 'Sys' is undefined

There may be various reason behind this issue. Below are the couple of solutions which is worth trying :

Solution 1: A quick solution is to update your web.config and add following section

<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>
 
Solution 2: Add the below code in <httpHandlers>
 
<add verb="GET"
  path="ScriptResource.axd"
  type="Microsoft.Web.Handlers.ScriptResourceHandler"
  validate="false"/>
 
Solution 3 : If you don't have this, add this too under <assemblies>
 
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
 PublicKeyToken=31bf3856ad364e35"/>
 
Solution 4 : f that doesn't work too, try deleting files from your "bin" folder
 and rebuild the solution and clear the cache of your browser.
 
Solution 5 : Add this to your web.config
 
<location path="ScriptResource.axd">
   <system.web>
      <authorization>
         <allow users="*"/>
      </authorization>
   </system.web>
</location>
 
Solution 6 : Repair .Net 3.5 SP1 installation from Control Panel - Add/Remove Programs,
as it may be possible an update to 3.5 SP1 can stop web-server delivering Ajax.
 
Final Solution 7 : this could be a caching/compression issue and by putting in the 
following into Web.Config, may resolves the issue. 
 
  <system.web.extensions>
    <scripting>
      <scriptResourceHandler enableCaching="false" enableCompression="false" />
    </scripting>
  </system.web.extensions> 

2 comments: