2

I'm new to MVC but am working hard to find my way through it. I'm currently at the point where I know enough to be dangerous, but not quite enough to actually do anything useful.

I'm building a site which I'd like to be very flexibly "skinable". It could also end up quite large, so I really want to use areas.

I'm thinking of throwing myself in the deep end and seeing if I can build a custom view engine that is both area aware and has theme support. I guess that it's kind of a hybrid of these two articles.

Before I start - and also, more to the point - "before I start, lose hair, finish, implement and build my massive app on it", can anyone comment if they think that this is a good idea?

I'm just wondering if there's a library out there that already does this, or a much easier way that I'm completely missing...

Any suggestions most welcome!!

Thanks in advance,

Z

Community
  • 1
  • 1
Damien Sawyer
  • 5,323
  • 3
  • 44
  • 56

1 Answers1

1

If you're going to do something, it's generally a good idea to have a good reason to do it.

If you're objective is to enable themes, the easiest way to do this is to set the theme in viewData and have a custom HtmlHelper include the necessary .css and .js references based on the viewdata's theme key.

For a more robust solution, Telerik has an open source extension of ASP.NET MVC, which is very useful for developing your UI and enables theme-functionality : http://demos.telerik.com/aspnet-mvc . Using their starter kit would probably save you a good bit of time.

smartcaveman
  • 41,281
  • 29
  • 127
  • 212
  • Thanks very much for that. I like your idea about changing the CSS and JS references. I think that I'm more thinking about fully customized views for different skins. The driver behind this is that the one web application is going to be rebranded for multiple companies. they will have completely different designs that go way beyond variations in CSS. I've built a similar system in Webforms which allowed for the optional switching in of different user controls for different brands. The more that I look at it, I'm wondering if I can use _ViewStart.cshtml to select different views to render. – Damien Sawyer Feb 13 '11 at 09:49