O'Reilly logo

A Programmer's Guide to .NET by Alexei Fedorov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.6. Validation controls and page validation

We have discussed the Page class in the previous chapter so shall only mention it briefly here. It is worth knowing that it has a Boolean property called IsValid. This property indicates whether or not the page validation has succeeded. By checking this property, we can find out programmatically if the user input has passed all validation rules defined by the validation controls on this page. Here is how it works.

The Page class maintains a list of all validation controls contained in the page in the Validators collection. This collection is an array of IValidator interfaces that are implemented by each validation control. The IValidator interface defines the Validate method and two properties – namely, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required