Monthly Archives: August 2010

Sys.Extended is undefined

Lately I've been playing around with the ToolKitScriptManager. I've read of some cool tricks to combine all those pesky scripts into one Javascript download. Not only would have make things much cleaner, it would reduce the overhead of files required to download. Now some of the projects that I work on rely heavily on Javascript to display the UI correctly. We love our clients so we wanted to do everything technically possible to speed up their monster application and the ToolKitScriptManager seemed like a logical place to start.

So I dropped a ToolKitScriptManager onto the page with a couple references to some commonly used files. And the result was my entire application breaking horribly in various places. Firebug reported a dreaded Sys.Extended is Undefined. Well that would be reason enough to revert all changes, but I wanted so bad for this feature to work I couldn't help but spend time researching to figure out the issue.

Basically it came down to the order of my composite scripts that fixed the issue. Instead of this


<compositescript>
<scripts>
<asp:scriptreference name="WebForms.js" assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
</asp:scriptreference>
<asp:scriptreference name="MicrosoftAjaxWebForms.js" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</asp:scriptreference>
<asp:scriptreference name="MicrosoftAjax.js" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
</asp:scriptreference>
</scripts>
</compositescript>



I had to reorder my scripts to this


<compositescript>
<scripts>
<asp:scriptreference name="WebForms.js" assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" scriptmode="Release"></asp:scriptreference>
<asp:scriptreference name="WebUIValidation.js" assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" scriptmode="Release"></asp:scriptreference>
<asp:scriptreference name="MicrosoftAjax.js" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" scriptmode="Release"></asp:scriptreference>
<asp:scriptreference name="MicrosoftAjaxWebForms.js" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" scriptmode="Release"></asp:scriptreference>
</scripts>
</compositescript>

Hope this helps anyone else with this issue.