Monday, December 28, 2009

'Sys' is undefined - ASP.NET 2.0 Ajax Control Toolkit

To fix this:
1. Open your web.config
2. Add this in between
<httpHandlers> </httpHandlers>
section
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>


Reference: here

The above would work fine, however it will give the following error:
Could not load type 'Microsoft.Web.Handlers.ScriptResourceHandler'.
ScriptResource.axd


Some suggested to change the code added to the following
<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"/>

(Change the word Microsoft to System)

But it gave me this javascript error:
Sys.ArgumentTypeException. Object of type 'Sys._Application' cannot be converted to 'Sys._Application'

In order to solve this will need to add this ScriptMode="Release" on the ScriptManager tag, like this:
<asp:ScriptManager id="ScriptManager1" runat="server" ScriptMode="Release">
</asp:ScriptManager>


Reference: here

No comments: