If you are getting Sys Is Undefined Error In Asp.Net Ajax Or SharePoint 2010 Applications, cause of error might be use of Sys namespace or reference in JavaScript placed in head section of page.
When page loads, above scripts executes before script manager and ajax framework loads, and throw the Sys is Undefined error.
To fix this error if adding following code in web.config file in system.web section doesn't work.
If this doesn't fix the error then remove javascript from head section of page, create an external js file and write your javascript in this external file and add it in solution explorer.
Place ScriptManager on the page and add external js file's path in ScriptReference.
This should fix the error.
When page loads, above scripts executes before script manager and ajax framework loads, and throw the Sys is Undefined error.
To fix this error if adding following code in web.config file in system.web section doesn't work.
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</httpHandlers>
If this doesn't fix the error then remove javascript from head section of page, create an external js file and write your javascript in this external file and add it in solution explorer.
Place ScriptManager on the page and add external js file's path in ScriptReference.
1: <asp:ScriptManager ID="ScriptManager1" runat="server">
2: <Scripts>
3: <asp:ScriptReference Path="~/Script.js" />
4: </Scripts>
5: </asp:ScriptManager>
This should fix the error.
If you like this post than join us or share
0 comments:
Post a Comment