Introduction: ASP.NET Web Forms

In this post, we will learn about 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 client browser. It is flexible and allows us to create and add custom controls as per our need.

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 enable us to set various things like properties, events and methods for the controls.For business logic, we can choose any .NET language like: Visual Basic or C#.

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

ASP.NET Web Forms

ASP.NET Web Forms

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 Name Control Events Description
Label None Label is used to display text on the HTML page.
TextBox TextChanged TextBox is used to create a text input in the form.
Button Click, Command Button is used to create a button.
LinkButton Click, Command LinkButton is used to create a button which looks similar to the hyperlink.
ImageButton Click ImageButton is used to create an imagesButton. An image works as a Button.
Hyperlink None Hyperlink is used to create a hyperlink control that responds to a click event.
DropDownList SelectedIndexChanged DropDownList is used to create a dropdown list control.
ListBox SelectedIndexCnhaged ListBox is used to create a ListBox control like the HTML control.
DataGrid CancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, PageIndexChanged, SortCommand, UpdateCommand, ItemCreated, ItemDataBound DataGrid is used to create a control that is used to show data. We can also perform various action like paging, sorting, and formatting very easily with this control.
DataList CancelCommand, EditCommand, DeleteCommand, ItemCommand, SelectedIndexChanged, UpdateCommand, ItemCreated, ItemDataBound DataList is used to create datalist that is non-tabular and used to show data.
Repeater ItemCommand, ItemCreated, ItemDataBound It 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.
CheckBox CheckChanged It is used to create checkbox.
CheckBoxList SelectedIndexChanged It is used to create a group of check boxes that all work together.
RadioButton CheckChanged It is used to create radio button.
RadioButtonList SelectedIndexChanged It is used to create a group of radio button controls that all work together.
Image None It is used to show image within the page.
Panel None It is used to create a panel that works as a container.
PlaceHolder None It is used to set placeholder for the control.
Calendar SelectionChanged, VisibleMonthChanged, DayRender It is used to create a calendar. We can set the default date, move forward and backward etc.
AdRotator AdCreated It allows us to specify a list of ads to display. Each time the user re-displays the page.
Table None It is used to create table.
XML None It is used to display XML documents within the HTML.
Literal None It 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 Name Description
Button It is used to create HTML button.
Reset Button Resets all other HTML form elements on a form to a default value
Submit Button Automatically POSTs the form data to the specified page listed in the Action attribute in the FORM tag
Text Field Gives the user an input area on an HTML form
Text Area Used for multi-line input on an HTML form
File Field Places 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 Field An input area on an HTML form, although any characters typed into this field are displayed as asterisks
CheckBox Gives the user a check box that they can select or clear
Radio Button Used two or more to a form, and allows the user to choose one of the controls
Table Allows you to present information in a tabular format
Image Displays an image on an HTML form
ListBox Displays 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.
Dropdown Displays 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 Rule Displays a horizontal line across the HTML page

I hope you got an idea about ASP.NET Web Forms.
I would like to have feedback from my blog readers.
Your valuable feedback, question, or comments about this article are always welcome.

Leave a Reply

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

Name *
Email *