asp.net mvc - MVC server-side validation on decimal values -
i've got problem validating model server-side in mvc. model has number of fields , every single 1 of them validates fine. problem have 2 decimal fields:
[required] [datatype(datatype.currency] [displayformat(convertemptystringtonull = true)] public decimal { get; set; } [datatype(datatype.currency)] [displayformat(convertemptystringtonull = true)] public nullable<decimal> b { get; set; }
if value null or string or b nullreferenceexception stacktrace can't analyze. try catch exception in controller, exception appears before gets there. if number value in , leave null or put number in b (just both valid), else goes expected - if there validation problems displayed, if not record saved in db. i've tried looking everywhere, maybe overlooked something... besides i've gotten bit rusty , validation never strong side. help!
Comments
Post a Comment