MVC找不到链接的部分视图

时间:2019-01-29 16:17:48

标签: c# asp.net asp.net-mvc asp.net-mvc-4 asp.net-mvc-partialview

给出两个项目:

Project.Common
> Helpers
>> _PartialView.cshtml

Project.FirstProject
> Views
>> Shared
>>> (linked) _PartialView.cshtml

我在_PartialView.cshtml上添加了一个对Project.FirstProjectProject.Common的链接引用:

enter image description here

但是,当我将文件复制到此位置时,什么有效不再适用于链接版本。

我收到经典的MVC“未找到视图”错误(为简便起见,我在这里将视图重命名):

The partial view '_PartialView' was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Home/_PartialView.aspx
~/Views/Home/_PartialView.ascx
~/Views/Shared/_PartialView.aspx
~/Views/Shared/_PartialView.ascx
~/Views/Home/_PartialView.cshtml
~/Views/Home/_PartialView.vbhtml
~/Views/Shared/_PartialView.cshtml
~/Views/Shared/_PartialView.vbhtml

为什么MVC找不到链接的局部视图?

0 个答案:

没有答案