Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

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

© 2015 Microsoft