ASP.NET Ajax client-side framework failed to load OR ‘Sys’ is undefined

I had an ASP.Net 4 website in WebForms, where it was working fine on the local machine and also on one of our Windows 2008 R2 servers which had Framework 4.0. But when we moved to the production machine which also had Windows 2008 R2 server, the website started to generate Ajax client-side framework failed to load errors on pages that had UpdatePanels.

After searching for some time, found the solution. This was actually caused by the fact that the website had an application pool set to .NET 4.0 but the [Handler Mappings] for the *.axd files were not registered. I had to add the following handlers to my web.config file.

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

After adding this, it’s working perfectly. But I am still not sure, why these handlers are already added to our testing server and not on production.