我想把一个模型传递到我的视图中,我尝试过以下方式:
public ActionResult Properties(string projet) {
string s = projet;
if (projet != null)
return View("Properties", s);
return RedirectToAction("Index", "Akeo");
}
在这个例子中,
projet
的值为 projet2
。在程序启动时,会出现以下错误:~/Views/Akeo/Properties.aspx
~/Views/Akeo/Properties.ascx
~/Views/Shared/Properties.aspx
~/Views/Shared/Properties.ascx
~/Views/Akeo/Projet 2.master
~/Views/Shared/Projet 2.master
~/Views/Akeo/Projet 2.cshtml
~/Views/Akeo/Projet 2.vbhtml
~/Views/Shared/Projet 2.cshtml
~/Views/Shared/Projet 2.vbhtml
其中一个视图未找到,但我创建了如下的视图 Properties
:
![schema](https://istack.dev59.com/3FRx5.webp)