我正在使用
@Html.EditorFor(m => Model.FileListBefore)
我想从视图内部获取“FileListBefore”名称。我怎样才能做到这一点?
编辑(更多信息):
'EditorFor(m => Model.FileListBefore)' 使用我自己的子视图。在该子视图中,我想检索调用该视图的属性的名称。
为什么?因为我在打电话
@Html.EditorFor(m => Model.FileListBefore)
@Html.EditorFor(m => Model.FileListAfter)
'FileListBefore' 和 'FileListAfter' 是相同类型的 'FileList' (我自己的类),它们调用相同的子视图。我想在子视图中获取调用名称('FileListBefore' 和 'FileListAfter),因为我想识别它们并将其添加为 div 'id' 值。