Html.EditorFor() - 便携式区域编辑器模板 [英] Html.EditorFor() -- editor template in portable area
问题描述
我想用在我看来,Html.EditorFor方法我的应用程序使用的局部视图编辑器模板。如果编辑模板是直接在我的应用程序的浏览/共享/ EditorTemplates目录,它的伟大工程。如果我用我的应用程序(这是我在用这个,所以我可以使用相同的模板不仅仅是这个应用程序的更多意图)便携式区域的查看/共享/ EditorTemplates目录编辑模板,它不被发现。有没有一种方法,我可以把它定位在便携领域的看法?
I am trying to use a partial view editor template in my application using the Html.EditorFor method in my view. If the editor template is directly in the Views/Shared/EditorTemplates directory of my application, it works great. If the editor template in the Views/Shared/EditorTemplates directory of the portable area I am using in my application (which is my intent in using this so I can use the same template in more than just this application), it is not being found. Is there a way I can make it locate the view in the portable area?
推荐答案
您可以指定模板的位置:
You could specify the location of the template:
<%= Html.EditorFor(x => x.Foo, "~/somepath/to/template.ascx") %>
这篇关于Html.EditorFor() - 便携式区域编辑器模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!