I am new to ASP.NET MVC and even newer to xVal however I was wondering if xVal can somehow work with the MVC built in validation in a smoother way?
For example a lot of samples show in the view controller calling TryUpdateModel() which returns bool if object is valid. This would be great to tie right into this and set the ModelState errors automatically like TryUpdateModel()
does but via xVal.
I am using ADO Entities and trying to implement model based validation via attributes applied via MetaDataType etc.
I would also like to avoid implementing IDataErrorInfo on all my classes from the Entity Framework. Is there any way we can make model based validation much easier to implement?
I'm hoping we can achieve the nirvana of just applying some attributes via the MetaDataType and make the rest smooth.
I almost had something like this working with PostSharp. I was using PostSharp to try and avoid any reflection as well but then I stumbled apon xVal and thought instead of re-inventing the wheel it would be good to look into xVal.
Also I am new to jquery etc, how do I in xVal define new CSS so the label shows up in red and the textbox border turns red etc? I haven't been able to find any documentation in xVal or jquery validation on CSS classes to define.
Also what if I want onblur validation? How in xVal can I define if I want this behavior?
Any help would be appreciated!