EditorTemplate
ViewModelでカスタムを使用したいという状況があります。だから私は私のViewModelを持っています...
class Aspect {
}
class AspectViewModel {
}
次に、私のEditorTemplate
- ビュー
- 共有
- EditorTemplates
- Aspect.cshtml
- EditorTemplates
- 共有
Aspect.cshtml
@model AspectViewModel
//その他のhtml
次に、をとる別のビューでAspectViewModel
、を呼び出します@Html.EditorFor(model => model)
が、機能しません。ハードコードされた文字列を使用する場合にのみ機能します@Html.EditorForModel("Aspect")
。
なぜ呼び出されないのか、何か考えはありますか?