最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do I combine WebResource.axd and ScriptResource.axd files so as to result in less requests to my ASP.NET server

programmeradmin3浏览0评论

On a site I'm working on, the pages are generating 45 external WebResource.axd and ScriptResource.axd files so the broswers have to request all 45 references. That's a lot of references so I'd like to know if there is a way that all of those requests could be combined into one request? I've seen that the Script Manager is supposed to be able to do something regarding that but I haven't seen any results with the WebResource.axd and ScriptResource.axd files.

How would I go about getting these to all combine?

On a site I'm working on, the pages are generating 45 external WebResource.axd and ScriptResource.axd files so the broswers have to request all 45 references. That's a lot of references so I'd like to know if there is a way that all of those requests could be combined into one request? I've seen that the Script Manager is supposed to be able to do something regarding that but I haven't seen any results with the WebResource.axd and ScriptResource.axd files.

How would I go about getting these to all combine?

Share Improve this question edited Jun 17, 2010 at 17:55 Jon Adams 25.1k18 gold badges84 silver badges121 bronze badges asked Feb 2, 2009 at 23:24 Paul MendozaPaul Mendoza 5,78712 gold badges56 silver badges85 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 13

As the others have stated, using the ASP.NET AJAX Toolkit's ToolkitScriptManager rather than the default ASP.NET ScriptManager will allow you to do some script combining, including your own scripts embedded as resources - there's a good post about it at Script combining made easy.

If you have the luxury of using ASP.NET 3.5 SP1, then there are some further additions to the ASP.NET ScriptManager that allow you to combine a lot more scripts, including general .js files in your solution into one script call.

Check out the video here:

Using Script Combining to Improve Performance

Try using ajax - ToolkitScriptManager instead of asp - ScriptManager - it tends to combine as much of the resource requests as it can.

here is a CodeProject article for both version of frameworks 2.0 & 3.5

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论