How to return dynamic CSS with ASP.NET MVC?

Posted by Morten Mertner on Stack Overflow See other posts from Stack Overflow or by Morten Mertner
Published on 2010-04-26T21:16:57Z Indexed on 2010/04/26 21:23 UTC
Read the original article Hit count: 219

Filed under:
|
|
|

I need a solution that lets me accomplish the following:

  • Returning CSS that is dynamically generated by an action method
  • Choosing CSS file depending on request parameter or cookie
  • Using a tool to combine and compress (minify) CSS

I am currently considering why there is no CssResult in ASP.NET MVC, and whether there might be a reason for its absence. Would creating a custom ActionResult not be the best way to go about this? Is there some other way that I've overlooked to do what I need?

Any other suggestions or hints that might be relevant before I embark on this task will also be appreciated :)

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc