开发者

Html.EditorFor() -- editor template in portable area

开发者 https://www.devze.com 2023-01-22 09:33 出处:网络
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 ap

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 u开发者_如何学Csing 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") %>
0

精彩评论

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