I'm a bit grey on what asp.net controls you still CAN use with MCV. What about the literal control? Yes it's all helper methods that spit out HTML but what if you need to add like a literal control or some other control to the Master page Header's collection?
+1
A:
You shouldn't use controls that depend on ViewState to maintain their state between postbacks. In MVC it doesn't make sense. Some of their functionality will still be available, even in MVC, but they were not designed to work in this environment.
You can place LiteralControl in page.
If you want to add css file depending on user preferences, you could place this in Site.Master:
<link href="~/Content/<%= ViewData["CssStyleFile"] %>.css" rel="stylesheet" type="text/css" />
Then you should have BaseController class:
public abstract class BaseController : Controller
{
public BaseController()
{
ViewData["CssStyleFile"] = "Something";
}
LukLed
2010-02-22 03:33:06