ASP.NET Web Forms

Web Forms are web pages built on the ASP.NET Technology. It executes on the server and generates output to the browser. It is compatible to any browser to any language supported by .NET common language runtime. It is flexible and allows us to create and add custom controls.

We can use Visual Studio to create ASP.NET Web Forms. It is an IDE (Integrated Development Environment) that allows us to drag and drop server controls to the web forms. It also allows us to set properties, events and methods for the controls. To write business logic, we can choose any .NET language like: Visual Basic or Visual C#.

Web Forms are made up of two components: the visual portion (the ASPX file), and the code behind the form, which resides in a separate class file.

ASP Web forms 1

Fig: This diagram shows the components of the ASP.NET

The main purpose of Web Forms is to overcome the limitations of ASP and separate view from the application logic.

ASP.NET provides various controls like: server controls and HTML controls for the Web Forms. We have tables all these controls below.


Server Controls

The following table contains the server-side controls for the Web Forms.

Control NameApplicable EventsDescription
LabelNoneIt is used to display text on the HTML page.
TextBoxTextChangedIt is used to create a text input in the form.
ButtonClick, CommandIt is used to create a button.
LinkButtonClick, CommandIt is used to create a button that looks similar to the hyperlink.
ImageButtonClickIt is used to create an imagesButton. Here, an image works as a Button.
HyperlinkNoneIt is used to create a hyperlink control that responds to a click event.
DropDownListSelectedIndexChangedIt is used to create a dropdown list control.
ListBoxSelectedIndexCnhagedIt is used to create a ListBox control like the HTML control.
DataGridCancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, PageIndexChanged, SortCommand, UpdateCommand, ItemCreated, ItemDataBoundIt used to create a frid that is used to show data. We can also perform paging, sorting, and formatting very easily with this control.
DataListCancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, UpdateCommand, ItemCreated, ItemDataBoundIt is used to create datalist that is non-tabular and used to show data.
RepeaterItemCommand, ItemCreated, ItemDataBoundIt allows us to create a non-tabular type of format for data. You can bind the data to template items, which are like bits of HTML put together in a specific repeating format.
CheckBoxCheckChangedIt is used to create checkbox.
CheckBoxListSelectedIndexChangedIt is used to create a group of check boxes that all work together.
RadioButtonCheckChangedIt is used to create radio button.
RadioButtonListSelectedIndexChangedIt is used to create a group of radio button controls that all work together.
ImageNoneIt is used to show image within the page.
PanelNoneIt is used to create a panel that works as a container.
PlaceHolderNoneIt is used to set placeholder for the control.
CalendarSelectionChanged, VisibleMonthChanged, DayRenderIt is used to create a calendar. We can set the default date, move forward and backward etc.
AdRotatorAdCreatedIt allows us to specify a list of ads to display. Each time the user re-displays the page.
TableNoneIt is used to create table.
XMLNoneIt is used to display XML documents within the HTML.
LiteralNoneIt is like a label in that it displays a literal, but allows us to create new literals at runtime and place them into this control.

HTML Controls

These controls render by the browser. We can also make HTML controls as server control. we will discuss about this in further our tutorial.

Controls NameDescription
ButtonIt is used to create HTML button.
Reset ButtonResets all other HTML form elements on a form to a default value
Submit ButtonAutomatically POSTs the form data to the specified page listed in the Action attribute in the FORM tag
Text FieldGives the user an input area on an HTML form
Text AreaUsed for multi-line input on an HTML form
File FieldPlaces a text field and a Browse button on a form and allows the user to select a file name from their local machine when the Browse button is clicked
Password FieldAn input area on an HTML form, although any characters typed into this field are displayed as asterisks
CheckBoxGives the user a check box that they can select or clear
Radio ButtonUsed two or more to a form, and allows the user to choose one of the controls
TableAllows you to present information in a tabular format
ImageDisplays an image on an HTML form
ListBoxDisplays a list of items to the user. You can set the size from two or more to specify how many items you wish show. If there are more items than will fit within this limit, a scroll bar is automatically added to this control.
DropdownDisplays a list of items to the user, but only one item at a time will appear. The user can click a down arrow from the side of this control and a list of items will be displayed.
Horizontal RuleDisplays a horizontal line across the HTML page





Latest Courses