开发者

Locate view fails when using areas

开发者 https://www.devze.com 2023-02-05 05:21 出处:网络
I have an area in my project but the view engine fails to find my view, it does not look for views in my areas directory?

I have an area in my project but the view engine fails to find my view, it does not look for views in my areas directory?

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/foo/Index.aspx ~/Views/foo/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/foo/Index.cshtml ~/Vie开发者_如何学Pythonws/foo/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml


You must specify the area you want to use when creating ActionLinks and if you're registering routes outside of the area.

<%=Html.ActionLink("Test", "Action", "Controller", new { area = "MyArea" }, null) %>
0

精彩评论

暂无评论...
验证码 换一张
取 消