What is Server Control in ASP.Net?

– Web server controls are special ASP.NET tags understood by the server.
There are three kinds of server controls: 
 –    HTML Server Controls – Traditional HTML tags
 –   Web Server Controls – New ASP.NET tags 

–  Validation Server Controls – For input validation 

          ASP.NET – HTML Server Controls         HTML server controls are HTML tags understood by the server.

              HTML elements in ASP.NET files are, by default, treated as text.
To make these elements programmable, add a runat=”server”
attribute to the HTML element. This attribute indicates that the
element should be treated as a server control. The id attribute is
added to identify the server control. The id reference can be used
to manipulate the server control at run time.
              Note: All HTML server controls must be within a

tag with
the runat=”server” attribute.
           The runat=”server” attribute indicates that the form should be
processed on the server. It also indicates that the enclosed
controls can be accessed by server scripts.


          runat=”server”>Meera Academy



ASP.NET – Web Server Controls
Web server controls are special ASP.NET tags understood by the server.Like HTML server controls, Web server controls are also created on the server and they require a runat=”server” attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements.

The syntax for creating a Web server control is:

Web Server Control Description

ButtonDisplays a push button

ImageButtonDisplays a clickable image 

LinkButtonCreates a hyperlink button

TextBoxCreates a text box

CalendarDisplays a calendar 

CheckBoxDisplays a check box 

LabelDisplays static content which is programmable (lets you apply styles to its content)

CheckBoxListCreates a multi-selection check box group 

DataGrid Displays fields of a data source in a grid 

DataList Displays items from a data source by using templates 

DropDownListCreates a drop-down list 

HyperLinkCreates a hyperlink 

ImageDisplays an image 

ListBoxCreates a single- or multi-selection drop-down list

LiteralDisplays static content which is programmable(does not let you apply styles to its content) 

PanelProvides a container for other controls 

PlaceHolderReserves space for controls added by code

RadioButtonCreates a radio button 

RadioButtonListCreates a group of radio buttons 

BulletedListCreates a list in bullet format Repeater Displays a repeated list of items  

TableCreates a table 

AdRotator Displays a sequence of images 

XmlDisplays an XML file or the results of an XSL transform

ASP.NET – Validation Server Controls

Validation server controls are used to validate user-input. If the user-input does not pass validation, it will display an error message to the user.
Each validation control performs a specific type of validation (like validating against a specific value or a range of values).
By default, page validation is performed when a Button, ImageButton, or LinkButton control is clicked. You can prevent validation when a button control is clicked by setting the CausesValidation property to false.

CompareValidator Compares the value of one input control to the value of another input control or to a fixed value

CustomValidator Allows you to write a method to handle the validation of the value entered

RangeValidator Checks that the user enters a value that falls between two values

]RegularExpressionValidator Ensures that the value of an input control matches a specified pattern

 RequiredFieldValidator Makes an input control a required field

ValidationSummary Displays a report of all validation errors occurred in a Web page

(Visited 1 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha *