Possible Duplicate:
Can .NET intercept and change css files?
I have configured IIS6 to get .NET to handle css files.
I did the following steps
- Launch IIS Manager
- Right-click on Default Web Site
- Click on the Home Directory tab
- Under Application Settings click on Configuration…
- Add a new association for .css and map it to .NET executable:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
How can I check if this is working, i.e. I want to change the default style of a page depending on the url, i.e. if the referer url is http://intranet, it should continue to use the old existing style style1.css, if the referer url is http://intranetv2, it should use the new style style2.css.
I would suggest that rather than doing this, you create a HTTP handler to serve your CSS file – this means that if you do have any static CSS files, they can continue to be dispatched quickly.
Example here:
http://aspnetresources.com/articles/variables_in_css
Final note from the comments below. In this case, what you could do is create you handler to serve your css file depending on the URL. In your project, do a ‘replace in all files’ of “mystylesheet.css” with “mystylesheethandler.ashx” and away you go.