草庐IT

DynamicDataItem

全部标签

c# - MVC 3.0 ModelBinder bindingContext.ValueProvider.GetValue(key) 在集合中绑定(bind)时返回 null

我是使用自定义ModelBinders的新手,我一直在四处寻找,但找不到与此特定案例相关的任何帖子。我有一个像这样的实体:publicclassDynamicData{publicIListDynamicDataItems{get;set;}}在View中,我将其绑定(bind)如下:@Html.EditorFor(model=>model.DynamicDataItems);我在类DynamicDataItems中有特殊信息,我想以特定方式检索这些信息,因此我创建了自己的模型绑定(bind)器。publicclassDynamicDataItemBinder:IModelBinder