asp.net-mvc feature - one css file per (view / master-page / user-control)

Posted by Mendy on Stack Overflow See other posts from Stack Overflow or by Mendy
Published on 2010-04-30T19:32:00Z Indexed on 2010/04/30 22:27 UTC
Read the original article Hit count: 300

I'm trying to implement the following feature:

I want just one css file to be attached for any page that I rendered. For example take StackOverflow site. For the questions page, we will have questions.css file.

so.com/questions              --->    questions.css
so.com/question/1234/title    --->    question.css
so.com/about                  --->    about.css
so.com/faq                    --->    faq.css

Now, I know that this css files share code in common, because they may have the same MasterPage(s) / UserControls. So, the solution need to take into account MasterPages, views and usercontrols as well.

So, what will be the right solution for this kind of problem?

I'm thinking about one solution, I'll put is as an answer, but maybe you have a better solution for this?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about css