Can you point MVC to a folder other than the default ones (Views/Shared/EditorTemplates & Views/Shared/DisplayTemplates)? I'd like to either put them in subfolders below those, or in other folders outside the Shared folder.
For example, if I have an editor template under this folder:
~ViewsOrderProductModel.cshtml
How can I tell my EditorFor template to use this tempalte name?
I tried fully qualifying it, but this doesn't work:
@Html.EditorFor(m => m.ProductModel, @"~ViewsOrderProductModel.cshtml")
I've tried using forward slashes & backslashes, with/without .chstml, every combination I can think of. I'm beginning to think this isn't supported, but I can't imagine why it wouldn't be.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…