Tuesday, July 7, 2009

How to remove error "'Sys' is undefined" ASP.NET

When anyone create a normal "ASP.NET Web Site" and not an "ASP.NET Ajax Enabled Web Site" and try to use AJAX Controls this error occurs.

There are two key tags, that must exist on web.config:

under <assemblies> (possibly you already have this one)
<add assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

under <httpHandlers> (this is the new one)
<add verb="GET" path="ScriptResource.axd" Type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>

If you use AJAX controls always try to create AJAX Enabled website.

If you already created Normal website and wish to use AJAX Controls you can copy following tag alongwith codes from WebConfig file from any AJAX Enabled website.

Copy assembly under assemblies tag;
copy httpHandlers tag and code under it; and
copy code under httpModules alongwith httpModules tag.



No comments:

Post a Comment

Heaven - it is ok but try to earn money at hellishdollars.com !