【发布时间】:2015-05-03 04:13:00
【问题描述】:
我正在使用一个名为 MVCForum 的项目,并在解决方案中创建了一个新项目,出于演示目的,我们将其称为“ExternalApp”。
现在,我已将 ExternalApp 引用添加到 MCVForum 应用程序中,并且可以调用控制器:http://mysite[.]com/TestController
“TestController”是我的外部控制器。也就是说,控制器存在于 ExternalApp 中。
问题是当我尝试从TestController中的“Test”返回视图时,找不到该视图。
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Themes/Metro/Views/Test/Index.cshtml
~/Themes/Metro/Views/Extensions/Test/Index.cshtml
~/Views/Extensions/Test/Index.cshtml
~/Views/Test/Index.cshtml
~/Views/Test/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
应用程序似乎在它自己的项目中寻找视图,而不是在 ExternalApp/Views 文件夹中。如何让我的外部应用呈现正确的视图?
【问题讨论】:
标签: c# .net asp.net-mvc razor model-view-controller