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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You could specify the location of the template:
<%= Html.EditorFor(x => x.Foo, "~/somepath/to/template.ascx") %>