问题描述
在我工作的一个网站时,页面将会产生45外部WebResource.axd的和的ScriptResource.axd文件,这样broswers有权要求所有45引用。这是一个很大的参考,所以我想知道是否有一种方法,所有这些请求可以合并成一个请求?我见过的脚本管理应该是能够做到这方面的东西,但我还没有看到的WebResource.axd的和的ScriptResource.axd文件的任何结果。
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?
推荐答案
由于其他人所说,使用ASP.NET AJAX工具包的ToolkitScriptManager而不是默认的ASP.NET ScriptManager可以让你做一些脚本相结合,包括您的自己的脚本嵌入的资源 - 在脚本合成变得容易。
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.
如果您在使用ASP.NET 3.5 SP1的奢侈品,然后有一些进一步增加的ASP.NET的ScriptManager,让您有更多的脚本,包括在解决方案中一般的.js文件合并成一个脚本调用
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.
在这里查看视频:
这篇关于如何合并WebResource.axd的和的ScriptResource.axd文件,从而导致对我的ASP.NET服务器请求少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!