0% found this document useful (0 votes)
1 views4 pages

Standard Controls in ASP

The document provides an overview of standard controls in ASP.NET, including Textbox, Button, Label, Image, ImageButton, DropDownList, CheckBox, CheckBoxList, RadioButton, RadioButtonList, Panel, AdRotator, Calendar, and HyperLink. Each control is described with its purpose, properties, and syntax for implementation. The document emphasizes the functionality and usage of these controls in web applications.

Uploaded by

Nikshitha B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views4 pages

Standard Controls in ASP

The document provides an overview of standard controls in ASP.NET, including Textbox, Button, Label, Image, ImageButton, DropDownList, CheckBox, CheckBoxList, RadioButton, RadioButtonList, Panel, AdRotator, Calendar, and HyperLink. Each control is described with its purpose, properties, and syntax for implementation. The document emphasizes the functionality and usage of these controls in web applications.

Uploaded by

Nikshitha B
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Standard controls in asp.

net

1. Textbox

The Textbox control is frequently used and one of the most important control. It is used to collect
information from a user. It is an input control which is used to input the data.
The Textbox control contains an important property called Textmode. By using this property you can
set textbox as
 SingleLine: This mode is default mode of textbox control and allows the user to enter data
in a single line of text.
 MultiLine: This mode enables user to enter text in more than one line
 Password: This mode masks (text is hidden) the values entered by the user.

2. Button
The Button is an asp.net web server control. The Button control is used to display a simple push
button on web page. we can display a simple push button on a web page by adding button control on
asp.net web page.
There are three type of button control in asp.net.
1. Simple Push Button – Simple Push Button displays text on a button control.
2. Link Button – Link button displays text that looks like a link or hyperlink.
3. Image Button – Image Button displays an image on a button control.
The Simple Push Button code is like:
<asp:Button ID=“Button1“ runat=“server“ Text=“Button“ />
The LinkButton code is like:
<asp:LinkButton ID=“LinkButton1“ runat=“server“>LinkButton</asp:LinkButton>
The ImageButton code is like:
<asp:ImageButton ID=“ImageButton1“ runat=“server“ />

All these three buttons has main two events one is Click and other is Command events. Click
event is default event with all buttons. All buttons have click event for write server side code
(c#, vb) in asp.net.
Some important property of ImageButton Control:
ID – identification of ImageButton control
ImageUrl – set image path to display image on image button control.
AlternateText – AlternateText text display when image can not display on web page.
PostBackUrl – Path of the page when redirect while click the Image button.
OnClientClick – write JavaScript or any client side script code function name.

3. Label

The Label control is used to display formatted text on web page in asp.net.Label is a most frequently
and common asp.net control for display text on web page. Label control display a text which is set
through the Text property. In website application the most frequently used controls are Button
control, Textbox control and Label control. We can change label style format by changing label
control property.
4. Image
An ASP.NET Image server control is a control that displays an image on the web page. The image is
sourced from either a location on the server or from a URL on the internet.
ASP.NET provides its own tag for the Image control which is run at the server and the generated
HTML code is returned as a response to the browser.

Syntax :<asp: Image ID=”ImageId” runat=”server” />

5. ImageButton

ImageButton control in ASP.Net is used in button formation by which we can use the images. It is
like a button with an image on it. Generally, we have seen the images on the website and after
clicking on it, certain activities performed. So, in this case, we need to use ImageButton control. It is
used to fire an event after clicking on the ImageButton either on the client or server-side. We can set
the image, which we want on the button. This image button will respond to the mouse click as soon
as we click. When we click the image button control, it raises both the events that click and
command events.

Syntax: <asp: ImageButton ID=”ImageButton” runat=”server” />

6. DropdownList Control

The DropDownList control is asp.net web server control. we can use dropdownlist control for hold
group of items. The dropdownlist control is used to store the multiple items and allow user to select
only one item from it.
The dropdownlist control is also known as combo box control. In dropdownlist control we can store
multiple items but we can select only one item at a time, that’s why it is also known as Single Row
Selection Box.

Syntax:<asp:DropdownList ID=”DropDownList1” runat=”server”></asp:DropDownList>

7. CheckBox

A checkbox is used to provide a list of options in which the user can choose multiple choices.
CheckBox control visually as square on web forms. The Checkbox control allow user to check
square or uncheck square.
In CheckBox control check and uncheck checkbox specify by the checked property of check box true
or false.If checkbox control square ticked then checked = true and unchecked then checked=false.

Syntax: <asp: Checkbox ID=“CheckBox1“ runat=“server“ />

8. CheckboxList

CheckBoxList is generally used, when you want to select one or more options from given several
choices. Most of the properties are same as RadioButtonList control, but the main difference is that
you can select more than one item from CheckBoxList control. This list of items in the
CheckBoxList can be dynamically generated using the Data Binding functions.

9. RadioButton

Radiobutton is a asp.net web server control. Radiobutton is used to allow user to select a single
radiobutton from group of radiobutton. In a asp.net generally we use more than one radiobutton and
select only one radiobutton at a time from all the radiobutton control. on other hand in checkbox
control we can check and uncheck multiple check box at a time.

Syntax:<asp:RadioButton ID=“RadioButton1“ runat=“server“ />

10. RadioButtonList

RadioButtonList Control is same as DropDownList but it displays a list of radio buttons that can be
arranged either horizontally or vertically. You can select only one item from the given
RadioButtonList of options. These options are mutually exclusive.

Possible values are as follows:


 Table
 Flow
 OrderedList
 UnorderedList

11. Panel

The Panel control works as a container for other controls on the page. It controls the appearance and
visibility of the controls it contains. It also allows generating controls programmatically.
Syntax:
<asp:Panel ID=”Panel1” runat=”server”>
The Panel control is derived from the WebControl class. Hence it inherits all the properties, methods
and events of the same. It does not have any method or event of its own.

12. AdRotator

The AdRotator control randomly selects banner graphics from a list, which is specified in an external
XML schedule file. This external XML schedule file is called the advertisement file.
The AdRotator control allows you to specify the advertisement file and the type of window that the
link should follow in the AdvertisementFile and the Target property respectively.
Syntax:

<asp:AdRotator runat=”Server” AdvertisementFile=”adfile.xml” Target=”blank”/>


13. Calendar

It is used to display selectable date in a calendar. It also shows data associated with specific date.
This control displays a calendar through which users can move to any day in any year. We can also
set Selected Date property that shows specified date in the calendar.

Syntax: <asp:Calendar ID = "Calendar1" runat = "server"></asp:Calendar>

14. Heyperlink

HyperLink control is used to redirect user to other page in asp.net. In asp.net link one web forms to
other using hyperlink control.The HyperLink control display both as text and as image by
specifying Text or ImageUrl property of hyperlink control.

If we set any image in ImageUrl property of hyperlink control then the hyperlink display image on
it.if we set any text value in Text Property of hyperlink control then the hyperlink control display as
text link.

You might also like