You are on page 1of 9

Controls

Label Control:
Usage: It is used to project any static
information on the web form.
Button:
Its usage is to submit the data.
TextBox:
Its usage is used to accept a single line multi
line or password character as the input.
Additional property for the TextBox:
textmode > used to specify the mode in which
the values has to be accepted as a input from
the user.
Maxlength > used to restrict the size of the
input provided by the user
ReadOnly > used to specify the control as a
non-editable control
Required Field Validator
 It is used to validate a control if it has been provided with

a value or not
Common Properties for all validation controls
 ControlToValidate:Specify the name of the control which

has to be validated
 ErrorMsg: Specify the message to be displayed if the

validation control fails


Compare Validator Control
 It is used to compare the value of one control with the

value of the other control


 Properties

 Control to compare:Specify the name of the control


which acts like a source control
 Operator:used to specify the mode to be used for
comparing the values of the controls.By Default it is
equal.
 Type:used to specify the datatypes for the values to be
compared
Points to remember
A validation control can always be binded to
a single control only.
A single standard control can be binded with
any no of validation controls
If the user doesn’t specify the input for the
binded control then all the validation
controls other than required field validator
will fail.
Radio Button Control
Usage: Used to select a single item from a collection
of radio buttons.
Properties:
Checked:returns true if the radio button is selected else returns false

User Name
Repeat Layout ->Table(default)
Items-> Male,female
Gender Male Female Repeat Direction->Horizontal

Qualification Inter
Degree
PG
Login

Group Name:Used to specify the radio button control belongs to a specific group.
Radio Button List Control
Usage: it is used to select a single item from a collection of
radio buttons
Common Properties for all the list controls with single
Selection
 SelectedItem.Textreturns the text value of the

selected list item


 SelectedItem.Valueextracts the selected list item

value.
 SelectedIndex  returns the index no of the selected

item.
 Repeat Direction  used to specify the direction in

which the list item has to be displayed (vertical is


default)
 Repeat layout  used to specify the layout in which the

list items has to be projected (table is default)


Requirements
 Items  it is a collection of list items
Drop Down List Control
Usage: it is used to select a single item from a
collection of list items
Properties for the drop down list will be exactly the
same as that of a list control with a single
selection.

User Name Sudhir


Country USA

Select
Array List
Usage: it is a collection which maintains the
information about a list of values which can be
considered as data source for any standard control.
 Syntax to define an array List
 dim variable as New ArrayList()
 To add the items to the array list variable
 Variable.Add(Value)
 To bind the arraylist variable as a datasource for any
standard control.
 controlName.Datasource = Variable
 To bind the data of the data source to the control
 ContorlName.DataBind()
 Note: when ever the databind method is used on any control
& if that statement is used in the PAGE_LOAD event then it
should be used carefully else the control will not maintain
its state
Check Box Control
Usage: Used to select a single one or more
items.
Property:
 Checked: returns true if the checkbox is

selected else returns false


Note: if only one control is required decision
making is required then go for checkbox
you can select or disselect.If you require
more than 2 then go for radiobutton.
Check Box List Control

Usage: it is used to select one or more checkbox list


items from a collection of list items.
Common Properties for all the list controls with
multiple Selection
 Items.Count  returns the no of list items present in

the list control


 Items(index).Selected returns true if the

specified item is selected else returns false.


 Items(Index).text  returns the text of the

selected item.
 Items(Index).value  returns the value of the

selected item.

You might also like