Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Script combining

I have replaced my asp:ScriptManager control with ajaxToolkit:ToolkitScriptManager with attribute CombineScripts="true".

Now when I view source of HTML page, there is new script tag:

<script src="/MyPage.aspx?_TSM_HiddenField_=ctl00__pageBody_asScript_tscAjaxScripts_HiddenField&amp;_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.0.20820.30277%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3a06e896ab-1f8c-4bcb-9cc4-0200671cba8a%3ae2e86ef9%3a1df13a87%3ac4c00916%3aaf22e781%3a9ea3f0e2%3ac7c04611%3acd120801%3a3858419b%3a96741c43%3a38ec41c0" />

But also are still old script tags: WebResource.axd and several ScriptResource.axd

How do I remove WebResource.axd and ScriptResource.axd links from the page?

like image 234
ihorko Avatar asked Aug 19 '26 18:08

ihorko


1 Answers

There are some components of the AjaxControlToolkit that do not support combining scripts. From: http://blogs.msdn.com/b/delay/archive/2007/06/11/script-combining-made-easy-overview-of-the-ajax-control-toolkit-s-toolkitscriptmanager.aspx

The Slider's SliderBehavior.js script uses a fairly obscure feature enabled by the PerformSubstitution property of the WebResource attribute that allows <%= WebResource/ScriptResource %> tags to be embedded in JS files and get resolved before the script is sent to the browser. This behavior isn't currently supported by ToolkitScriptManager

There's no magical flag you can turn on to completely get rid of these file. The advantage of using the ToolKitScriptManager is that it will reduce the number of resources your page requires, leading to better performance. The Webresource.axd and Scriptresouce.axd files are used by the entire application, and not just the AjaxControlToolkit. My advice would be to use a program like Fiddler to see what resources the Scriptresource.axd and Webresource.axd are actually pulling in and work from there.

like image 136
Joshua Avatar answered Aug 22 '26 09:08

Joshua