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

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -