asp.net mvc框架之View的查找

1.return View()会查找Views的Controller名字的Action的名字的cshtml

2.return View(“Action1”),查找Views的Controller名字下的“Action1.cshtml”,如果找不到则到特殊的Shared文件夹下找"Action1.cshtml"。

3.return View("Action1")中如何传递model?return View("Action1",model)。陷阱:如果model传递的是string类型,则需要return View("Action1",(object)str)。

posted @ 2019-06-11 15:47  black娃  阅读(436)  评论(0编辑  收藏  举报