你能否将MVC指向默认文件夹以外的文件夹(Views/Shared/EditorTemplates&Views/Shared/DisplayTemplates)?我想将它们放在子文件夹下面的子文件夹中,或者放在Shared文件夹之外的其他文件夹中.
例如,如果我在此文件夹下有一个编辑器模板:
〜\查看\订单\ ProductModel.cshtml
如何告诉我的EditorFor模板使用这个tempalte名称?
我试过完全限定它,但这不起作用:
@Html.EditorFor(m => m.ProductModel, @"~\Views\Order\ProductModel.cshtml")
Run Code Online (Sandbox Code Playgroud)
我尝试过使用正斜杠和反斜杠,有/无.chstml,我能想到的每一个组合.我开始认为这不受支持,但我无法想象为什么它不会.