This documentation is archived and is not being maintained.

ASP.NET Server Controls by Function

Visual Studio .NET 2003

The ASP.NET server controls are listed here according to general function. The following sections individually provide details about Web server controls, HTML server controls, and validation controls.

Note   For more about the differences between Web and HTML server controls, see Introduction to ASP.NET Server Controls.

Web Server Controls

Web server controls include traditional user-entry controls as well as special-purpose controls such as a calendar. All Web server controls can be bound to a data source.

Note   You can also create output for mobile devices. To do so, you use the same ASP.NET page framework, but you create Mobile Web Forms instead of Web Forms pages and use controls specifically designed for mobile devices. For details, see Creating ASP.NET Mobile Web Applications.

The Web server controls are listed below according to their function.

Security Note   User input in a Web Forms page can include potentially malicious client script. By default, the Web Forms page validates that user input does not include script or HTML elements. For more information, see Scripting Exploits and Protecting Against Script Exploits in a Web Application.
Text display (read only)LabelDisplays text that users cannot directly edit.
Text editTextBoxDisplays text that can be edited by users at run time or changed programmatically.
Selection from a listDropDownListAllows users to select from a list that appears when the user clicks a button.
 ListBoxDisplays a list of choices. Optionally, the list can allow multiple selections.
Graphics displayImageDisplays an image.
 AdRotatorDisplays a sequence (predefined or random) of images.
Value settingCheckBoxDisplays a box that users can click to turn on and off.
 CheckBoxListCreates a grouping of check boxes. The list control makes it easy to create check boxes using data binding.
 RadioButtonDisplays a single button that can be turned on or off.
 RadioButtonListCreates a grouping of radio buttons. Inside the group, only one button can be selected.
Date settingCalendarDisplays a graphic calendar to allow users to select a date.
Note   These controls always cause the form to be posted to the server for processing.
ButtonPerforms a task.
 LinkButtonLike a Button control, but has the appearance of a hyperlink.
 ImageButtonLike a Button control, but incorporates an image instead of text.
NavigationHyperLinkCreates a Web navigation link.
Table manipulationTableCreates a table.
 TableCellCreates an individual cell within a table row.
 TableRowCreates an individual row within a table.
Grouping other controlsCheckBoxListCreates a collection of check boxes.
 PanelCreates a borderless division on the form that serves as a container for other controls.
 RadioButtonListCreates a grouping of radio buttons. Inside the group, only one button can be selected.
Selection from a listRepeaterDisplays information from a data source using a set of HTML elements and controls you specify, repeating the elements once for each record in the data set.
 DataListLike the Repeater control, but with more formatting and layout options, including the ability to display information in a table. The DataList control also allows you to specify editing behavior.
 DataGridDisplays information, usually data-bound, in tabular form with columns. Provides mechanisms to allow editing and sorting.
Place holdingPlaceHolderEnables you to place an empty container control in the page and then dynamically add child elements to it at run time.
 LiteralRenders static text into a Web page without adding any HTML elements.
 XMLReads XML and writes it into a Web Forms page at the location of the control.

HTML Server Controls

HTML server controls map directly to HTML elements. The controls listed in this section are predefined controls. However, any HTML element can be made into a control; in that case, the control supports a generic set properties and methods. All HTML server controls can be bound to a data source.

FormsHtmlFormDefines an HTML form. The values of controls within the form are posted to the server when the form is submitted.
Text editHtmlInputTextDisplays text that can be edited by users at run time, or changed programmatically.
 HtmlTextAreaDisplays large quantities of text. Used for multi-line text entry and display.
Note   These controls always cause the form to be posted to the server for processing.
HtmlAnchorEnables Web navigation.
 HtmlButtonPerforms a task. This control can contain any arbitrary HTML, and therefore it is very flexible in look and feel. However, it is not compatible with all browsers.
 HtmlInputButtonPerforms a task. This button is supported on all browsers.
 HtmlInputImageLike a button, but displays a graphic.
Selection from a listHtmlSelectDisplays a list of text and graphical items (icons).
Graphics displayHtmlImageDisplays an image.
Information storageHtmlInputHiddenStores state information for a form (information that needs to be available with each round trip to the server).
NavigationHtmlAnchorCreates a Web navigation link.
Value settingHtmlInputCheckboxCreates a box that users can click to turn on and off. The CheckBox control includes a label.
 HtmlInputRadioButtonDisplays a button that can be turned on or off. Radio buttons are typically used to allow the user to select one item from a short list of fixed options.
Table manipulationHtmlTableCreates a table.
 HtmlTableRowCreates an individual row within a table.
 HtmlTableCellCreates an individual cell within a table row.
File transferHtmlInputFileAllows users to specify files to upload to a server. (The server must allow uploads.)
Other functionsHtmlGenericControlCreates a basic object model (properties, methods, events) for any HTML element converted to a control.

Validation Controls

Validation controls provide you with a way to check user input in Web or HTML server controls. The following table lists the type of validation controls you can use in Web Forms. For more details, see Web Forms Validation.

Type of validationControl to useDescription
Required entryRequiredFieldValidatorEnsures that the user does not skip an entry.
Comparison to a valueCompareValidatorCompares a user's entry against a constant value or a property value of another control using a comparison operator (less than, equal, greater than, and so on).
Range checkingRangeValidatorChecks that a user's entry is between specified lower and upper boundaries. You can check ranges within pairs of numbers, alphabetic characters, and dates. Boundaries can be expressed as constants or as values derived from another control.
Pattern matchingRegularExpressionValidatorChecks that the entry matches a pattern defined by a regular expression. This type of validation allows you to check for predictable sequences of characters, such as those in social security numbers, e-mail addresses, telephone numbers, postal codes, and so on.
User-definedCustomValidatorChecks the user's entry using validation logic that you code yourself.
NoneValidationSummaryDisplays the error messages of all other validation controls on the page in a single unified summary.

See Also

Creating and Programming ASP.NET Server Controls | ASP.NET Server Controls Recommendations | Web Forms Validation