@ crawford.r
if I understand you correctly, there may be one named textbox field which I will call textboxfieldA.
(1) sometimes textboxfieldA may be missing. this is an error.
(2) at other times, textboxfieldA may be empty. this too is an error.
In case (1), ModelState may or may not contain an error. I do not know.
In case (2), ModelState should not contain an error unless you do validation AFAIK.
My understanding of Controller ===> View ===> Controller flow in an ASP.NET MVC application, which still is incomplete, is that it works some like this.
Controller, as a messenger, delivers "data" to the View. View renders the data in HTML.
[possibility: if the textbox is not available in the View, then the View could create a proxy textbox with a value like "required".]
End user clicks a submit button that returns "data" to the Controller; on the way to the Controller, any bound "data" gets readied to be delivered to the data store (e.g.: an SQL database); some data may be unbound.
Back in the Controller (usually via a POST request) a decision to either return the View with errors to the end user or accept the results and affect the data store is made, usually based on the ModelState.IsValid property.
Strategy: partially ignore blind faith use of ModelState.IsValid if the condition is false. If ModelState.IsValid is true, no problem. If ModelState.IsValid is false, determine if there was only one error and if that error was an unacceptable value in textboxfieldA; if this is the case, accept the "data" as if ModelState.IsValid had been true. Otherwise, follow your error procedure which likely will be to return the View to the end user for correction.
Does that make any sense?
If it does, will it work for you?
Regards,
Gerry (Lowry)
Gerry Lowry, Principal
Ability Business Computer Services ~~ Because it's your Business, our Experience Counts!
68 John W. Taylor Avenue
Alliston · Ontario · Canada · L9R 0E1 · gerry.lowry@abilitybusinesscomputerservices.com
Websites:
http://abilitybusinesscomputerservices.comhttp://gerrylowryprogrammer.com ~~
résumé & testimonials
http://veganoccasions.com ~~ recipes by
Susan