Combine CSS requests WebResource.axd

I have developed some ASP.NET server controls that include their own javascript and css files. Many of these controls use jQuery extensions, which, as you know, often contain their own css files.

I use Telerik RadScript manager, which integrates javascript as a boss. However, I use the AjaxToolkit ClientCssResource attribute to include css files in my server controls, and I noticed that CSS files are not merged at all. My pages have 10-15 WebResource.axd requests for css files for my server controls.

All I find is just a javascript join, and nothing tells me how I can combine CSS files. Does anyone know if there is a way to combine CSS dynamically (I don't want to combine it manually, since each page can use a different subset of the server controls)?

+5
source share
3 answers

To do this, you need to write your own IHttpHandler. There is a working example. Combine several JavaScript and CSS files and delete service data.

+1
source

Optimize WebResource.axd and ScriptResource.axd

It also compresses them.

, , . , - /, , ms.

+1

The CombineAndMinify component ( http://www.codeproject.com/Articles/125159/Package-that-speeds-up-loading-of-JavaScript-CSS-a ) combines and minimizes WebResource.axd files with CSS definitions (those that are loaded through links in the page title). Not sure if this will help in your case, but it is definitely worth a try.

0
source

All Articles