When i try to do this:
public ActionResult Index(string page)
{
IndexViewModel model = new IndexViewModel();
return ("~/Themes/_Layout.cshtml", model);
}
It gives me the error The name 'model' does not exist in the current context on the first line @model InnodiaCMS.Models.Controllers.IndexViewModel
But it all works fine when _Layout.cshtml is in the shared folder.
But i need it to be in Themes folder! How can i do this?
You need to copy the
<system.web.webPages.razor>section from~/Views/Web.configto~/Themes/Web.config.For more information, see my blog post.