如何合并WebResource.axd的和的ScriptResource.axd文件,从而导致对我的ASP.NET服务器请求少? [英] How do I combine WebResource.axd and ScriptResource.axd files so as to result in less requests to my ASP.NET server?

查看:117
本文介绍了如何合并WebResource.axd的和的ScriptResource.axd文件,从而导致对我的ASP.NET服务器请求少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我工作的一个网站时,页面将会产生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可以让你做一些脚本相结合,包括您的自己的脚本嵌入的资源 - 在<一个有关于它的一个很好的职位href=\"http://blogs.msdn.com/delay/archive/2007/06/11/script-combining-made-easy-overview-of-the-ajax-control-toolkit-s-toolkitscriptmanager.aspx\"相对=nofollow>脚本合成变得容易。

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服务器请求少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆