.net, Ajax, C#, Code, Microsoft, Technical

‘Sys’ is undefined – ASP.Net Ajax error

I was using ASP.NET 2.0 along with Ajax Extensions 1.0. I received this error ‘Sys’ is undefined error message every time I used an Ajax control. I was pulling my hair out on it and decided to give the Control Toolkit’s web.config a glance. The following lines were not available in my web.config, so i copied them over:

<httpHandlers>
            <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”/>
</httpHandlers>
<httpModules>
            <add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″/>
</httpModules>

P.S: These lines go inside the System.Web section of your web.config file

Bingo.. the error vanished and all my controls started to function as they should πŸ™‚

 

Technorati Tags: ,,
Advertisements

14 thoughts on “‘Sys’ is undefined – ASP.Net Ajax error

  1. Thanks!! it worked!,

    the only problem i had after copy the code, was some hiden characters, i had to copy to notepad and replace the hex characters for “.

    Thanks!

  2. FYI, initially my project worked perfectly on my local machine, but I faced the same problem on the Server which is also being configured as a DNS with active directory hosting multiple sites.

    This didn’t exactly worked for me but led me to my solution. I’ve tried many many versions of web.config that claimed to worked but just not for me. What did work for me was I have to explicitly copy the file ScriptResource.axd into my published folder. The server is running Windows Server 2003 adv server IIS6 ASP.NET 2.0 (VS 2005).

  3. THANK YOU!!!

    I was pulling my hair out over this. Lost an entire day trying to resolve it. Followed your recommendation and it took care of everything.

    Again thank you for posting what you found. It would have taken me all week to get to this point. Thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s