O'Reilly logo

ASP.NET in a Nutshell by Matthew MacDonald, G. Andrew Duthie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 38. The System.Web.UI.WebControlsNamespace

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 straightforward elements like Button to sophisticated controls like Calendar, AdRotator, and DataGrid. Web controls are more abstract than HTML controls. Rather than wrapping 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 features for paging, sorting, and automatic selection and editing. You can also use the DataList class for a templated list or the Repeater class for a simple data-bound repeater that allows completely customized layout but has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required