You are on page 1of 11

ASP.

NET Standard Controls

Presented By

SATNAM KAUR
Standard Controls
Literal
Display Information
Label

Textbox
Accept User Input Checkbox
RadioButton
Button
Standard Controls Submit Form Data LinkButton
ImageButton

Image
Displaying Images
ImageMap

Panel Control

HyperLink Control
Displaying Information
Literal: Simply displays the text and does not support formatting properties. This is because, the contents
of literal are not contained in <span> tag. This can be verified by using “view page source” option on
browser.
Label: displays text and also supports several additional below mentioned formatting properties because
the contents of literal are not contained in <span> tag.
 BackColor
 BorderColor
 BorderStyle
 BorderWidth
 Font
 Style
 ForeColor
Displaying Information
Literal Label

Using these properties, color, border,


etc. can be assigned to label. But, these
properties can not be used for literal.
Example, in above figure, we assigned
purple and green color as back color
and border color to label, respectively.
For both label as well as literal, we use
Text property to write on them
User Input- TextBox
Enables to get input from the user of web application. It has following properties:
TextMode: displays 3 types of input
 SingleLine- displays a single-line input field
 MultiLine- displays a multi-line input field. After setting TextMode to multiline, row property is used to set number of lines to
display
 Password- displays a single-line input field with hidden text
Text- to get or set text of TextBox
ReadOnly- set to true if we don’t want the user to change the text.
MaxLength- to set the maximum length that user can enter
Columns- to specify the width of TextBox in characters
Width- set width in pixels
Height- set height in pixels
AutoPostBack- automatically postback when text is changed.
ToolTip- displayed when mouse is on control
Wrap- text wrap functionality in multiline mode
User Input- TextBox
TextBox Events-
TextChanged- This event is fired, when the text in the textbox is changed.
Methods:
Focus- to set input focus onto the control.
- If we call Focus method for multiple textboxes, only last textbox will receive the focus.
User Input- RadioButton
Allows to select only one option from the available choices.
Enables to provide the user with mutual exclusive choices. It has following properties:
Text- to set or get the text.
Checked- Boolean property, used to check if the button is checked or not
TextAlign- on which side of radio button, text will appear
AutoPostBack- webform immediately posted back following some changes in RadioButton selection
Group Name- to make RadioButton a mutually exclusive one.
Events:
CheckedChanged- when the checked status of radiobutton control is changed, this event fires.
User Input- RadioButton
Text, TextAlign and Checked Property
TextAlign Right TextAlign Left

Text and Checked Property Event- CheckedChanged

GroupName- give same groupName to all buttons to


make them mutually exclusive
User Input- CheckBox
Allows to select more than one option from the available choices. It has following properties:
Text- to set or get the text.
Checked- Boolean property, used to check if the button is checked or not
TextAlign- on which side of radio button, text will appear
AutoPostBack- webform immediately posted back following some changes in RadioButton selection
Events:
CheckedChanged- when the checked status of radiobutton control is changed, this event fires.
 Methods
Focus- to set input focus onto the control.
User Input- CheckBox
Text, TextAlign and Checked Property
TextAlign Right TextAlign Left

Text and Checked Property Event- CheckedChanged


Data Sources
https://www.youtube.com/watch?v=omeMCTvxzX0&list=PL6n9fhu94yhXQS_p1i-HLIftB9Y7Vnxlo&index=10.
https://www.youtube.com/watch?v=jyghYnwXvKI
https://www.youtube.com/watch?v=2kj3m6-7JQw
Book ASP.NET Unleashed

You might also like