Rendering stylesheets from ASHX handler

Go To StackoverFlow.com

1

I'm creating a CMS, and I want to dynamically load the style from the database. I've created a ASHX handler that returns the stylesheet. I then reference the handler like this:

<link href="/Assets/Get.ashx?aid=1" rel="stylesheet" type="text/css" />

When I click on the link in a browser it loads the stylesheet as expected. However, when I inspect element I find that none of the styles are being applied.

Is this something that just isn't possible?

2012-04-04 03:43
by Paul


2

Is your ASHX handler setting the correct Content-Type (text/css) on the response?

2012-04-04 03:45
by Dave Ward
No it wasn't. Thank you - Paul 2012-04-04 03:47
Ads