开发者

Which javascript scriptreference is linked to each ScriptResource.axd?

Google Page Speed is saying we should combine external JavaScript. Fair enough.

I know that the way to do this is to use a CompositeScript tag inside asp:ScriptManager.

<asp:ScriptManager runat="server">
   <CompositeScript>
      <Scripts>
         <asp:ScriptReference Name="AjaxControlToolkit.Common.Common.js" Assembly="AjaxControlToolkit" />
         <asp:ScriptReference Name="AjaxControlToolkit.Calendar.CalendarBehavior.js" Assembly="AjaxControlToolkit" />
         < ... />
      </Scripts>
    </CompositeScript>
</asp:ScriptManager>

What I don't know is which script references to add. In my page I have lots of

<script src="/ScriptResource.axd?d=big-string开发者_开发知识库-here" type="text/javascript"></script>

How do I discover what <asp:ScriptReference Name="x" Assembly="Y" /> tags I should add to the CompositeScript tag?

There's a usercontrol out there with this specific aim, and we even have already used it before, but I can't find it again o Google.


EDIT

The usercontrol I was looking for is ScriptReferenceProfiler. How to use it.

I still accepted the answer bellow because it may help someone else in the same situation.


I believe if you use AJAX Toolkit's ToolkitScriptManager then it would anyway combine all ScriptResource and WebResource scripts by default (you need not have to mention these). See these related posts: How do I combine WebResource.axd and ScriptResource.axd files so as to result in less requests to my ASP.NET server?

In .NET4, ScriptManager should also able to do the same: http://www.hanselman.com/blog/ASPNETAjaxScriptCombiningAndMovingScriptResourceaxdsToStaticScripts.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜