开发者

Locate view fails when using areas

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜