我们使用带有编辑器模板的 Kendo 网格。在 Kendo 提供的示例中,他们将模板存储在所有视图的全局共享文件夹中:~/Views/Shared/EditorTemplates。
在我们的项目中,我们使用区域,将模板存储在特定区域和控制器的共享文件夹中更为合适和合乎逻辑。但是,如果我们将其存储在一个区域内,则无法找到该模板。
我们尝试了几种结构的变体: ~/Areas/SomeArea/Views/SomeView/Shared/EditorTemplates/editor.cshtml ~/Areas/SomeArea/Views/SomeView/EditorTemplates/editor.cshtml
以及网格中对应的路径: .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("/Shared/Editortemplate/editor")
或 .Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("/Editortemplate/editor")
但是,出现的不是我们的模板,而是默认模板。
我们哪里做错了?谢谢!