How to toggle on/off all validation controls on a web form for testing
Posted on 2007-11-18
I've got a bunch of web forms done with Visual Studio 2005 that have or will have validaiton on each field; mostly RequiredFieldValidators, but others as well.
I want to be able to throw a button on the form temporarily so I can disable all the validation controls for testing purposes. I sometimes need to test what happens after "Submit" and don't want to have to fill out 165 questions on a form just to see if the next step works.
It's probably not hard to "For each validationControl on this page set Enabled=False" but I'm a beginner and I couldn't find any code to do this.