Troubleshooting the "'Sys' is Undefined" Error When Using AJAX Extensions for ASP.NET

If you've put together some ASP.NET code that uses some of the AJAX extensions, but the code doesn't work and you get a client script error that states "'Sys' is undefined", you're not alone. I've experienced this error myself, and none of the stuff I found on the web concerning the error helped me out any. But I was able to resolve the problem, and here's how: I added the following lines to the httpHandlers section of my web.config file.

<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>

This did the trick for me. If this still doesn't help you out, try creating a new AJAX-Enabled website and copying anything from it's web.config file that isn't in your existing web.config.

UPDATE: If you're getting this error (or the similar "Sys is not defined") in your client-side code, check out this post.

Comments

Anonymous said…
Thank you so much. It really helps get rid of this uber annoying problem. But just to make it more clear, here is the place you have to put in...

system.web
httpHandlers
....the code here....
/httpHandlers
/system.web

Popular Posts

Resolving the "n timer(s) still in the queue" Error In Angular Unit Tests

How to Get Norton Security Suite Firewall to Allow Remote Desktop Connections in Windows

How to Determine if a Column Exists in a DataReader

Silent Renew and the "login_required" Error When Using oidc-client

Fixing the "Please add a @Pipe/@Directive/@Component annotation" Error In An Angular App After Upgrading to webpack 4