views:

44

answers:

1

I am migrating an Asp.Net 2.0 WebSite to an Asp.Net MVC 2.0 Application. In the Asp.Net WebSite Themes and skin features are used for customizing UI.

I would like to handle this in Asp.Net MVC 2.0. Is there a good way to migrate the Themes and Skins in Asp.Net MVC 2.0.

EDIT: I have looked into some of the solutions on the net and other Stackoverflow questions. But the solution suggested are to create Views/Master pages for each Themes which looks like to me as a violation of DRY principal.

+1  A: 

ASP.NET MVC does not natively handle themes. It is designed to product clean HTML that you can apply stylesheets to. Themes work on controls, MVC has no concept of controls.

This question has been asked before and there are some workarounds: http://stackoverflow.com/questions/769878/asp-net-mvc-themes-how-to

David Neale
@David: Please look into my EDIT.
Amitabh
@Amitabh. Good point about the DRY principle. I'd suggest the cleanest way to go about this is to create stylesheets (some shared, some dependent on user configuration) and swap the configurable ones programmatically - `<link rel="stylesheet" type="text/css" href="<%= Model.SelectedStyleSheet %>"/>` Check out Mauricio Scheffer's answer on that linked question.
David Neale