
821
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
Chapter 42WebControls Namespace
42
The System.Web.UI.
WebControls Namespace
The System.Web.UI.WebControls namespace contains types used for web controls. Web
controls are ASP.NET’s most full-featured controls and range from straightfor-
ward elements like Button to sophisticated controls like Calendar, AdRotator, and
DataGrid. Web controls are more abstract than HTML controls. Rather than wrap-
ping specific HTML elements, web controls can consist of a combination of
HTML elements and vary their user interface depending on the capabilities of the
client browser. They also provide a richer set of formatting properties and events.
For example, all input controls provide an AutoPostback property that, when set to
True, allows your code to react immediately to a Change event (like a checkbox
being checked or a new list selection).
This namespace contains the WebControl class, which is the base class for all web
controls. Web controls include traditional standards like TextBox, Button, RadioButton,
and CheckBox, and more unusual and advanced controls like Calendar, AdRotator, and
the list controls CheckBoxList and RadioButtonList.
Some of the most interesting controls in this namespace include those used for
data-bound tables. Typically, DataGrid provides the most powerful options, with