Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Combine WebResource.axd CSS requests

Tags:

asp.net

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

I'm using Telerik's RadScript manager which combines the javascript like a boss. However, I'm using the AjaxToolkit's ClientCssResource attribute to include the css files in my server controls, and I have noticed that the CSS files are not getting combined at all. My pages have 10-15 WebResource.axd requests for css files for my server controls.

Everything I find only is about combining javascript, and nothing tells me how I can combine the CSS files. Does anyone know if there is a way to combine the CSS dynamically (I don't want to manually combine as each page might use a different subset of the server controls)?

like image 622
tster Avatar asked Nov 05 '22 08:11

tster


1 Answers

You will need to write your own IHttpHandler for this. There is a working example at Combine Multiple JavaScript and CSS Files and Remove Overheads.

like image 61
Giorgi Avatar answered Nov 09 '22 07:11

Giorgi