ASP.NET AJAX ToolkitScriptManager Issue With Combining Scripts
I have an ASP.NET 3.5 web application in which i am using the ToolkitScriptManager as below:
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" EnablePageMethods="true" ScriptMode="Release"
LoadScriptsBeforeUI="false" runat="server" CombineScripts="false">
<CompositeScript>
<Scripts>
<asp:ScriptReference Path="~/JavaScript/jquery-1.4.1.min.js" /&g开发者_运维百科t;
<asp:ScriptReference Path="~/JavaScript/Validators.js" />
</Scripts>
</CompositeScript>
</ajaxToolkit:ToolkitScriptManager>
This works fine but from a performance standpoint this is not good as the pages are making a lot of requests to the webresources.axd and scriptresource.axd files. When I changed the CombineScripts property to true my ASP.NET AJAX control extenders are no longer working. What is the reason for this weired behavior and is there a fix for this?
In order to enable an actual script combination, you have to implement a IHttpHandler and reference it into the CombineScriptsHandlerUrl 's porperty of your ToolkitScriptManager.
You have a full example in the sample application delivered with the lastest version of the ControlToolkit ;-)
Oinant
精彩评论