asp.net.ph

BaseValidator.IsValid Property

System.Web.UI.WebControls Namespace   BaseValidator Class


Sets or retrieves a value specifying whether the associated input control passes validation.

Syntax


Script Validator.IsValid [ = true | false ]

This property can only be used programmatically; it cannot be set when declaring the control.

Property Value

This property accepts or returns only a boolean value: true if the associated input control passes validation; otherwise, false. Default value is true.

Remarks

Use the IsValid property to determine whether the associated input control passes validation.

Since the default value of this property is true, it will return true if you query this property before validation is performed. For example, this might occur if you attempt to use this property in the Control.Load event of page.

The IsValid property is only evaluated when the Validate method is called. You can call the Validate method for each validation control on the page individually, or call all of them at once by using the Page.Validate method. Button controls with their CausesValidation property set to true will also call the Page.Validate method.

It is possible to change the value of this property manually after validation has taken place. This allows you to override the validation result, if necessary. The Page.IsValid property for the page is set to true only if the IsValid property for each validation control on the page is also set to true.

See Also

BaseValidator Members   Base Validation Control Properties Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph