This documentation is archived and is not being maintained.

Validate Method (Common)

.NET Framework 1.1

Performs control validation, and then sets the IsValid property based on the results of the validation.

public virtual void Validate()


The following is a list of the classes that inherit the Validate method from the BaseValidator class.


The Validate method causes the IsValid property of the control to be set to true or false, depending on the outcome of the validation test.


The following example demonstrates how to use the Validate method to validate that the text entered by a user falls within the permitted range.

Sub OnCmdClick(sender As Object, e As EventArgs)
   If Page.IsValid Then
      ActiveForm = Form2
   End If
End Sub 


void OnCmdClick(Object sender, EventArgs e)
   if (Page.IsValid)
     ActiveForm = Form2;

See Also

Applies to: BaseValidator Class