【发布时间】:2023-04-09 02:24:01
【问题描述】:
当我尝试这样做时:
public ActionResult Index(string page)
{
IndexViewModel model = new IndexViewModel();
return ("~/Themes/_Layout.cshtml", model);
}
它在第一行 @model InnodiaCMS.Models.Controllers.IndexViewModel 上给了我错误 The name 'model' does not exist in the current context
但当 _Layout.cshtml 位于共享文件夹中时,一切正常。
但我需要它在主题文件夹中!我该怎么做?
【问题讨论】:
标签: asp.net-mvc asp.net-mvc-3 razor asp.net-mvc-routing