简体   繁体   English

在ASP.NET 4 WebForms中压缩和缩小WebResource.axd和ScriptResource.axd

[英]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>

Some more notes 还有一些说明

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.

相关问题 在ASP.NET中/ScriptResource.axd和/或/WebResource.axd的简称? - Shorter names for /ScriptResource.axd and/or /WebResource.axd in ASP.NET? ASP.NET Web应用程序 - WebResource.axd和ScriptResource.axd文件 - 加载时间问题 - ASP.NET web application - WebResource.axd and ScriptResource.axd files - Loading time issue 回到未来的ASP.NET:修复了耗时的WebResource.axd / ScriptResource.axd吗? - ASP.NET back to the future: fix for time-travelling WebResource.axd / ScriptResource.axd? 如何组合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? 多个应用程序和CDN的相同WebResource.axd / ScriptResource.axd - same WebResource.axd / ScriptResource.axd for mulltiple applications and CDN 减少ScriptResource.axd的根本技巧? (以及可选的WebResource.axd) - Radical techniques for reducing ScriptResource.axd? (and optionally WebResource.axd) WebResource.axd和ScriptResource.axd加载速度非常慢 - WebResource.axd and ScriptResource.axd load very slowly ScriptResource.axd和WebResource.axd中的语法错误 - Syntax error in ScriptResource.axd and WebResource.axd WebResource.axd和ScriptResource.axd获取方法失败 - WebResource.axd and ScriptResource.axd Get Method Failed ScriptResource.axd和.Net 4 - ScriptResource.axd and .Net 4
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM