Sideway from Sideway
Draft for Information Only


ASP.NET Web Forms Server Controls
 HTML Server Controls
  Features of HTML Server Controls
  Types of HtmlControls
 Web Server Controls
  Features of Web Server Controls
  Types of Web Server Controls
   Basic Web Controls
   Validation controls
   List controls
    Types of ASP.NET List Control
   Rich Controls
  Other Types of Web Server Controls
   User Controls
   Custom controls
 Sources and References

ASP.NET Web Forms Server Controls

ASP.NET server controls are HTML server controls, Web server controls, List controls etc.


ASP.NET Web Forms Server Controls may fall into the following Microsoft .NET Framework Class Library namespaces:
  • System.Web.UI.HtmlControls.HtmlControl
  • System.Web.UI.WebControls.WebControl

HTML Server Controls

The HTML server controls are HTML elements that include a runat=server attribute. The HTML server controls have the same HTML output and the same properties as their corresponding HTML tags. In addition, HTML server controls provide automatic state management and server-side events.

Features of HTML Server Controls

Typical features of HTML server controls are
  • The HTML server controls map one to one with their corresponding HTML tags.
  • When the ASP.NET application is compiled, the HTML server controls with the runat=server attribute are compiled into the assembly.
  • Most controls include an OnServerEvent for the most commonly used event for the control. For example, the <input type=button> control has an OnServerClick event.
  • The HTML tags that are not implemented as specific HTML server controls can still be used on the server side; however, they are added to the assembly as HtmlGenericControl.
  • When the ASP.NET page is reposted, the HTML server controls keep their values.
The System.Web.UI.HtmlControls.HtmlControl base class contains all of the common properties. HTML server controls derive from this class. To use an HTML server control, use the following syntax (which uses the HtmlInputText control as an example): <input id="Text1" type="text" value="hello world" runat=server />

Types of HtmlControls

For more information about individual HTML server controls that are available in ASP.NET, see the following Web sites:
HtmlAnchor ControlControls an <a> HTML element HtmlButton ControlControls a <button> HTML element HtmlForm ControlControls a <form> HTML element HtmlGeneric ControlControls other HTML element not specified by a specific HTML server control, like <body>, <div>, <span>, etc. HtmlImage ControlControls an <image> HTML element HtmlInputButton ControlControls <input type="button">, <input type="submit">, and <input type="reset"> HTML elements HtmlInputCheckBox ControlControls an <input type="checkbox"> HTML element HtmlInputFile ControlControls an <input type="file"> HTML element HtmlInputHidden ControlControls an <input type="hidden"> HTML element HtmlInputImage ControlControls an <input type="image"> HTML element HtmlInputRadioButton ControlControls an <input type="radio"> HTML element HtmlInputText ControlControls <input type="text"> and <input type="password"> HTML elements HtmlSelect ControlControls a <select> HTML element HtmlTable ControlControls a <table> HTML element HtmlTableCell ControlControls <td> and <th> HTML elements HtmlTableRow ControlControls a <tr> HTML element HtmlTextArea ControlControls a <textarea> HTML element

Web Server Controls

Web controls are similar to the HTML server controls such as Button, TextBox, and Hyperlink, except that Web controls have a standardized set of property names.

Features of Web Server Controls

Typical features of HTML server controls are
  • Make it easier for manufacturers and developers to build tools or applications that automatically generate the user interface.
  • Simplify the process of creating interactive Web forms, which requires less knowledge of how HTML controls work and make the task of using them less prone to errors.
The System.Web.UI.WebControls.WebControl base class contains all of the common properties. Most of the Web server controls derive from this class. To use a Web server control, use the following syntax (which uses the TextBox control as an example): <asp:textbox text="hello world" runat=server />

Types of Web Server Controls

Web server controls can be divided into four categories:
Basic Web ControlsControls to provide the same functionality as their HTML server control counterparts. Validation ControlsControls to validate the values that are entered into other controls of the page. List ControlsControls to support binding to collections. Rich ControlsControls to provide rich functionality with multiple HTML elements.

Basic Web Controls

Basic Web controls provide the same functionality as their HTML server control counterparts. However, basic Web controls include additional methods, events, and properties against which you can program. For more information about individual Web controls that are available in ASP.NET, see the following Web sites:
Button Web Server ControlDisplays a push button CheckBox Web Server ControlDisplays a check box HyperLink Web Server ControlCreates a hyperlink Image Web Server ControlDisplays an image ImageButton Web Server ControlDisplays a clickable image Label Web Server ControlDisplays static content which is programmable LinkButton Web Server ControlCreates a hyperlink button Literal Web Server ControlDisplays static text. Panel Web Server ControlProvides a container for other controls PlaceHolder Web Server ControlReserves space for controls added by code RadioButton Web Server ControlCreates a radio button Table Web Server ControlCreates a table TableCell Web Server ControlCreates a table cell TableRow Web Server ControlCreates a table row TextBox Web Server ControlCreates a text box

Validation controls

Validation controls are used to validate the values that are entered into other controls of the page. Validation controls perform client-side validation, server-side validation, or both, depending on the capabilities of the browser in which the page is displayed. Validation controls offer the following advantages: You can associate one or more validation controls with each control that you want to validate. The validation is performed when the page form is submitted. You can specify programmatically whether validation should occur, which is useful if you want to provide a cancel button so that the user can exit without having to fill valid data in all of the fields. The validation controls automatically detect whether validation should be performed on the client side or the server side. Note A client-side validation catches errors before a postback operation is complete. Therefore, if you have combinations of client-side and server-side validation controls on a single page, the server-side validation will be preempted if a client-side validation fails.For more information about individual validation controls that are available in ASP.NET, refer to the following Web sites:
CompareValidator ControlCompares the value of one input control to the value of another input control or to a fixed value CustomValidator ControlAllows you to write a method to handle the validation of the value entered RangeValidator ControlChecks that the user enters a value that falls between two values RegularExpressionValidator ControlEnsures that the value of an input control matches a specified pattern RequiredFieldValidator ControlMakes an input control a required field ValidationSummary ControlDisplays a report of all validation errors occurred in a Web page

List controls

List controls are special Web server controls that support binding to collections. You can use list controls to display rows of data in a customized, template's format. All list controls expose DataSource and DataMember properties, which are used to bind to collections. List controls can bind only to collections that support the IEnumerable, ICollection, or IListSource interfaces.
Types of ASP.NET List Control
BulletedListCreates a list in bullet format CheckBoxList Web Server ControlCreates a multi-selection check box group DataGrid Web Server ControlDisplays fields of a data source in a grid DataList Web Server ControlDisplays items from a data source by using templates DropDownList Web Server ControlCreates a drop-down list ListBox Web Server ControlCreates a single- or multi-selection drop-down list RadioButtonList Web Server ControlCreates a group of radio buttons Repeater Web Server ControlDisplays a repeated list of items bound to the control

Rich Controls

In addition to the preceding controls, the ASP.NET page framework provides a few, task-specific controls called rich controls. Rich controls are built with multiple HTML elements and contain rich functionality. Examples of rich controls are the Calendar control and the AdRotator control. For more information about individual rich controls that are available in ASP.NET, see the following Web sites:
AdRotator Web Server ControlDisplays a sequence of images Calendar Web Server ControlDisplays a calendar Xml Web Server ControlDisplays an XML file or the results of an XSL transform

Other Types of Web Server Controls

User Controls

Often, you may want to reuse the user interface of your Web Form without having to write any extra code. ASP.NET enables you to do this by converting your Web Forms into user controls. User controls, which have the.ascx file extension, can be used multiple times within a single Web Form. To convert a Web Form into a user control, follow these steps: Remove all <html>, <head>, <body>, and <form> tags. If the @ Page directive appears in the page, change it to @ Control. Include a className attribute in the @ Control directive so that the user control is typed strongly when you instantiate it. Give the control a descriptive file name, and change the file extension from .aspx to .ascx. For more information about user controls, see Web Forms User Controls.

Custom controls

In addition to the built-in Web controls, ASP.NET also allows you to create your own custom controls. It may be useful to develop custom controls if you are faced with one of these scenarios: You need to combine the functionality of two or more built-in Web controls. You need to extend the functionality of a built-in control. You need a control that is different than any of the controls that currently exist. For more information about developing custom controls, see the following topics: Developing ASP.NET Server Controls Developing Custom Controls: Key Concepts Developing a Composite Control

Sources and References



ID: 210900030 Last Updated: 9/30/2021 Revision: 0 Ref:



  1. Active Server Pages,  ,
  2. ASP Overview,  ,
  3. ASP Best Practices,  ,
  4. ASP Built-in Objects,  ,
  5. Response Object,  ,
  6. Request Object,  ,
  7. Server Object (IIS),  ,
  8. Application Object (IIS),  ,
  9. Session Object (IIS),  ,
  10. ASPError Object,  ,
  11. ObjectContext Object (IIS),  ,
  12. Debugging Global.asa Files,  ,
  13. How to: Debug Global.asa files,  ,
  14. Calling COM Components from ASP Pages,  ,
  15. IIS ASP Scripting Reference,  ,
  16. ASP Keywords,  ,
  17. Creating Simple ASP Pages,  ,
  18. Including Files in ASP Applications,  ,
  19. ASP Overview,  ,
  20. FileSystemObject Object,  ,
  21.,  , ADO Object Model
  22. ADO Fundamentals,  ,

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna

Home 5






Hobbies 8


Chinese 1097

English 339

Reference 79


Hardware 249


Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19


Web 289

Unicode 504


CSS 65

SVG 46


OS 429

DeskTop 7

Python 72



Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21


Tables 8


Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5


Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1

Copyright © 2000-2023 Sideway . All rights reserved Disclaimers last modified on 06 September 2019