2010-10-18 28 views
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

回答