[英]Compress and Minify WebResource.axd and ScriptResource.axd in ASP.NET 4 WebForms
I have been trying for a week now to reduce the number of requests on our web application but I can't seem to combine the .axd
files. 我已经尝试了一个星期来减少我们的Web应用程序上的请求数量,但我似乎无法合并
.axd
文件。 I got a suggestion from somewhere which worked locally (development box) but doesn't work on our test and production environment as they are both on HTTPS
. 我从一个本地工作的地方(开发箱)得到了一个建议但是在我们的测试和生产环境中不起作用,因为它们都在
HTTPS
。 The developer didn't comment on that and the component he wrote was last updated in 2011. (I will find the link and update this post). 开发人员没有对此发表评论,他撰写的组件最后一次更新于2011年。(我将找到该链接并更新此帖子)。
I tried using the CompositeScript
in ScriptManager
and again it doesn't work on Test/Production environments. 我尝试在
ScriptManager
使用CompositeScript
,并且它再次无法在测试/生产环境中使用。
I used SquishIt to resolve the other files. 我使用SquishIt来解析其他文件。 (see attachment)
(详见附件)
To force it work on your environment, set ScriptMode="Release"
eg as: 要强制它在您的环境中工作,请设置
ScriptMode="Release"
例如:
<asp:ScriptManager ID="ScrMang" runat="server" ScriptMode="Release" >
<CompositeScript>
<Scripts>
<asp:ScriptReference name="MicrosoftAjax.js"/>
<asp:ScriptReference name="MicrosoftAjaxWebForms.js"/>
<asp:ScriptReference name="Common.Common.js" assembly="AjaxControlToolkit"/>
</Scripts>
</CompositeScript>
</asp:ScriptManager>
To find what scripts to add inside CompositeScript
you can use the code from here : http://aspnet.codeplex.com/releases/view/13356 and get more help how to use it from this page : https://lancezhang.wordpress.com/2008/11/15/aspnet-ajax-performance/ 为了找到里面添加了什么脚本
CompositeScript
你可以从这里使用代码: http://aspnet.codeplex.com/releases/view/13356并获得更多的帮助,如何从这个页面使用它: HTTPS://lancezhang.wordpress .COM / 2008/11/15 / ASPNET-AJAX性能/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.