Wednesday, August 1, 2007

AJAX Error: Error: Sys is undefined

AJAX Enabling an Existing ASP.NET Website!!

A common mistake new AJAX developers make is to just start adding AJAX controls to their existing ASP.NET 2.0 web project. However after adding say the time it will let you know that you need a scriptmanager control. That's easy, drag-drop , press F5 or right click, view in browser. Waaaahhh no AJAX, just a Javascript error in the bottom right of IE7, which when expanded states:
AJAX Error: Error: Sys is undefined
Well if we had started out with an AJAX-enabled Website and looked closely at the Web.config we would have noted one very important difference between the two:

<httpmodules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpmodules>


For more info:
How Do I: Add ASP.NET AJAX Features to an Existing Web Application?

No comments: