Question

I hope someone can help me out to disable the default validation that MVC 3 runs when I post a string value in an integer field. Currently the application will add the error “the value ‘abc’ is not valid for IntergerProperty” to the ModelState before our validators are executed.

We don’t use client side validation and have our own validators that are loaded in the Global.asax. We only want to use these validators to check the input and would like to disable this check.

Is it possible to disable this behavior?

Thanks in advanced,

André

Was it helpful?

Solution

I think the best solution for your issue is to implement a custom model binder to override the default behavior if you really want/need to be able to take alpha chars in a numeric field.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top