gimmi/extdirecthandler

ASP.NET MVC 3 validation for complex types

DavidSSL opened this issue · 4 comments

Hi,

Can you tell me if validation will be triggered if I pass a "complex" type collection as a parameter to my Controller's action?

Regards,

David

There is no specific MVC code in ExtDirectHandler, so no validation out of the box. But you can implement this kind of "aspect" with AOP support, see here:

https://github.com/gimmi/extdirecthandler/wiki/AOP-example

Hi Gimmi,

I apologise for not being clearer. I've got my model classes with validation DataAnnotations. Hence, I don't expect ExtDirectHandler to perform validation but for ASP.NET MVC to handle that. However, it might be contingent upon the implementation of ExtDirectHandler.

For instance, I'm currently using another .NET implementation of Ext.Direct and although binding is working, ASP.NET validation, which had been working, doesn't work anymore, although I'm currently not sure why and don't have the time to research it.

So really, the question is whether, from what you know, ASP.NET MVC data annotation validation of complex types will work or not. :)

David

David

Sorry, i've never used it.
I can suggest you to take a look to NHibernateValidator (that can be used without NH) or FluentValidator http://fluentvalidation.codeplex.com/

Thanks Gimmi.