0
嗨,我们正在尝试将我们的项目升级到VS 2010的最新版本,并且我遇到了旧的Data Annotations Modelbinder的问题。新mvc中的数据注释modelbinder
昏暗ModelBinder的=新DataAnnotationsModelBinder()
modelBinder.InvalidValueFormatter = _ 功能(propDescriptor作为PropertyDescriptor的,值作为字符串,显示名作为字符串)_ 的String.Format(“ '{0}' AR EJ ETT korrekt瓦德{1}“值,显示名)
ModelBinders.Binders.DefaultBinder = modelBinder
什么即时试图做的是要在此改变了错误的DataInput默认的ErrorMessage(”值“{0}”是无效的{1 }字段)。
我试图让默认的模型绑定器为其分配一个新的ErrorMessage
,那么你应该纪念这个答案为“正确”,以避免混淆。 – 2010-10-18 13:36:08