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

编程入门 行业动态 更新时间:2024-10-26 19:39:10
本文介绍了在 ASP.NET 4 WebForms 中压缩和缩小 WebResource.axd 和 ScriptResource.axd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经尝试了一个星期来减少我们的 Web 应用程序上的请求数量,但我似乎无法合并 .axd 文件.我从本地工作(开发箱)的某个地方得到了一个建议,但在我们的测试和生产环境中不起作用,因为它们都在 HTTPS 上.开发者没有对此发表评论,他写的组件最后一次更新是在 2011 年.(我会找到链接并更新这篇文章).

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. 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. 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).

我尝试在 ScriptManager 中使用 CompositeScript,但它再次不适用于测试/生产环境.

I tried using the CompositeScript in ScriptManager and again it doesn't work on Test/Production environments.

我使用 SquishIt 来解析其他文件.(见附件)

I used SquishIt to resolve the other files. (see attachment)

推荐答案

要强制它在您的环境中工作,请设置 ScriptMode="Release" 例如:

To force it work on your environment, set ScriptMode="Release" eg as:

<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>

更多注意事项

要查找要在 CompositeScript 中添加的脚本,您可以使用以下代码:aspnet.codeplex/releases/view/13356 并从这个页面获得更多关于如何使用它的帮助:lancezhang.wordpress/2008/11/15/aspnet-ajax-performance/

Some more notes

To find what scripts to add inside CompositeScript you can use the code from here : aspnet.codeplex/releases/view/13356 and get more help how to use it from this page : lancezhang.wordpress/2008/11/15/aspnet-ajax-performance/

更多推荐

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

本文发布于:2023-11-25 01:14:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627715.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:WebForms   NET   ASP   ScriptResource   axd

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!