views:

32

answers:

1

I have a an ASP.NET MVC2 application, with Linq2SQL, that updates a database without using the UpdateModel. Is it still possible to trigger validation without using UpdateModel?

+1  A: 

Validation is built into the default model binder. So there is no need to call UpdateModel or anything else to trigger the validation.

Mattias Jakobsson
I have a custom validation using data annotations with a buddy class. This only triggers when I call UpdateModel.
Danny
@Danny, Can you please show your code? The only thing UpdateModel does is use the model binder and the binder itself handles the validation. So there shouldn't be any difference.
Mattias Jakobsson