
828
|
Chapter 42: The System.Web.UI.WebControls Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Hierarchy
System.Object ➝ System.Web.UI.Control(System.ComponentModel.IComponent, System.
IDisposable, System.Web.UI.IParserAccessor, System.Web.UI.IDataBindingsAccessor)
➝
WebControl(System.Web.UI.IAttributeAccessor) ➝ BaseDataList
Subclasses
DataGrid, DataList
BaseValidator
System.Web.UI.WebControls (system.web.dll)
disposable
abstract class
This abstract class is the basis for all validation controls. It supplies a Validate( ) method,
which does not return a value, but updates the IsValid property. When using validation
controls on a Web Forms page, you should check the System.Web.UI.Page.IsValid property.
This value will be True only if all validation controls on the page have successfully vali-
dated their input. The BaseValidator class also provides various other methods that are
not used directly when creating a Web Forms page.
The ControlToValidate property specifies the control that a validator will verify. The ErrorMes-
sage property specifies the message that will be displayed in the validation control if
validation fails, although this text can be overridden by changing the validation
control’s Text property. The ErrorMessage will also appear in a page’s ValidationSummary
control, if present.
By default, ASP.NET will not