在的RenderPartial共享文件夹的子文件夹。如何使MVC找到它? [英] Renderpartial in subfolder of Shared folder. How to make MVC find it?
问题描述
短而简单?
我有一个edit.ascx是在共享文件夹。我把它称为是这样的:
<%Html.RenderPartial(编辑,item.hlpb_ID); %GT;
如果我把它放在一个子文件夹,它无法找到该文件,如何解决?
在你如何安排你的观点来看,你可以把你的意见在子文件夹,如果你想创建自己的视图结构。所有的观点总是可以通过使用〜语法的完整路径被引用。所以,如果你把在的Index.aspx \\查看\\特征1 \\首页,那么你可以使用〜/浏览次数引用视图/特征1 /首页/ Index.aspx的。
块引用>- <一href=\"http://stackoverflow.com/questions/26715/asp-net-mvc-subfolders\">http://stackoverflow.com/questions/26715/asp-net-mvc-subfolders
Short but simple?
I have an edit.ascx is in the shared folder. I call it like this:
<% Html.RenderPartial("edit", item.hlpb_ID); %>
If I put it in a subfolder, it cant find the file, how to fix that?
解决方案In terms of how you arrange your views, you can put your views in subfolders if you'd like and create your own view structure. All views can always be referenced by their full path using the ~syntax. So if you put Index.aspx in \Views\Feature1\Home then you could reference that view using ~/Views/Feature1/Home/Index.aspx.
-- http://stackoverflow.com/questions/26715/asp-net-mvc-subfolders
这篇关于在的RenderPartial共享文件夹的子文件夹。如何使MVC找到它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!