Compress and Minimize WebResource.axd and ScriptResource.axd in ASP.NET 4 WebForms

I have been trying for a week to reduce the number of requests in our web application, but I can not merge the files .axd. I got an offer from somewhere where I worked locally (development box), but it doesn’t work in our test and production environment, since they are on HTTPS. The developer did not comment on this, and the component that he wrote was last updated in 2011. (I will find the link and update this post).

I tried using CompositeScriptin ScriptManagerand does not work again in Test / Production environments.

I used SquishIt to resolve other files. (see Attachment)

enter image description here

+4
source share
1 answer

To make it work in your environment, install ScriptMode="Release", for example:

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

To find out which scripts to add inside CompositeScript, you can use the code here: http://aspnet.codeplex.com/releases/view/13356 and get more information on how to use this from this page: https: //lancezhang.wordpress .com / 2008/11/15 / aspnet-ajax-performance /

+6
source

Source: https://habr.com/ru/post/1548506/


All Articles