Playing with a Mobile application in ASP.NET MVC4 beta, using great that article, but having issues with Display modes. Namely, I try to use
@{
ViewBag.Title = "ASP.NET Articles";
DisplayModes.RequireConsistentDisplayMode = true;
}
inside my _ViewStart.cshtml, but getting an complition error:
Compilation Error
Description: An error occurred during the compilation of a resource
required to service this request. Please review the following specific
error details and modify your source code appropriately.Compiler Error Message: CS0103: The name ‘DisplayModes’ does not exist
in the current context
Does any one see that as well?
The linked article is from September 12, 2011 so it seems they changed the API.
Try this (it works in MVC4 beta):