ASP.NET
ASP.NET
<asp:TableRow>
.
.
.
asp:TableCell>
</asp:TableRow>
</asp:Table>
Properties of table control :-
1. BackImageUrl : Specifies URL of background image.
2. Caption : It is used to give a caption to the table.
3. CaptionAlign : Specifies the alignment of caption.
4. CellPadding
5. CellSpacing
6. HorizontalAlign
7. Rows : It specifies the row collection of table.
Properties of rows :-
1. Cells : Specifies the cells collection of particular row.
Properties of cell :-
1. ColumnSpan
2. RowSpan
E.g Content.aspx :-
Enter your name:
</asp:Textbox>
<br/>
Content.aspx.vb :-
Partial Class Content
Inherits System.Web.UI.Page
Protected Sub btnsubmit_Click (ByVal Sender As object, ByVal e As
System.EventArgs) Handles btnsubmit.Click
Dim str As String
lbl.Text=str
End Sub
End Class
Properties of label control :-
1. ID
2. TabIndex
3. Text
4. ToolTip
5. Visible
6. AccessKey
7. Runat
2. Literal Control :-
When we want to render text and control directly on a page without any markup,
we use a literal control.
It reserves a location on the web page to display static text.
We can edit the text in a literal programmatically at run time.
It is similar to label exception that is does not support any formatting properties.
Properties of literal control :-
1. ID
2. Text
3. Visible
4. EnableViewState
5. Runat
6. Mode :- It specifies how the content in the literal will be rendered on the page.
Literal :
1. Default text property is set to null.
2. Literal tag does not rendered as html element.
3. We can not apply any formatting.
4. We can use Literal between title tag.
3. Textbox Control :-
It is like the html textbox control which allows the user to enter some text.
The Asp.net textbox control is flexible and can be configured to support single
line, multiple or password modes.
Properties of textbox control :-
1. AutoPostBack :
It is a Boolean property which specifies whether the control will post the
contents automatically to the server when the content of control changes.
2. Columns :
It specifies the width of textbox.
3. Rows :
It specifies the number of rows when the text mode is multiline.
5. ReadyOnly :
It is a Boolean value which specifies whether the user can edit the content
of textbox.
6. Wrap :
It is a Boolean value which specifies whether to wrap text or not.
7. MaxLength :
It specifies the maximum number of character that can be entered in the
textbox.
8. Text
9. Visible
End Sub
End Class
5. Button Control :
</asp:Textbox>
btnS S -
txtA
</asp:Textbox>
</form>
Content.aspx.vb:
Partial Class Content
Inherits System.Web.UI.Page
Protected Sub btnA_Command (ByVal sender As object, ByVal e As
System.Web.UI.webcontrols.CommandEventArgs) Handles btnA.Command,
BtnS.Comamnd, btnM.Comamnd, btnD.Command
Dim no1, no2 As Double
no1=txtA.Text
no2=txtB.Text
6. ImageButton Control :-
It is used to display clickable image. To set the image for this control, we use the
ImageUrl property.
It also supports both click and command events like button control.
Properties of ImageButton control :-
be posted to.
2. ImageUrl : It Specifies the URL of the image to be set on the button.
3. CommandName : The name of the command associated with the command
event.
It is used to select a single option from a list of given items. It is also known as
option button.
We use radio buttons for attributes like gender, qualification, category, mcqs etc
where multiple options are given but we select only one.
For this, we create a radio button group such that whenever one button is
selected others get unselected.
Properties of Radio Button Control :-
1. Checked: A Boolean value which specifies whether the radio button is checked
or not.
2. GroupName: The name of the group to which a radio button belongs. So that
only one can be selected at a time.
3. AutoPostBack: A Boolean value which specifies whether the control will
postback immediately after the checked property is changed.
4. Text: Specifies the text next to the radio button.
5. TextAlign: Specifies the alignment of the button.
Events of Radio Button control :-
1. CheckedChanged
E.g RadioBtnEg.aspx :
RadioBtnEg.aspx.vb :
Partial Class RadioBtnEg
Inherits System.Web.UI.Page
Protected Sub rdFy_CheckedChanged (ByVal sender AS object, ByVal e As
System.EventArgs) Handles rdFy.CheckedChanged
If rdFy.Checked = True then
End If
End Sub
End Class
8. CheckBox Control :-
It is a web server controls that provides user to switch between yes or no or true
or false options.
It is ideally used to give multiple options to the user.
Properties of Checkbox control :-
1. AutoPostBack
2. Checked
3. Text
Events :-
1. CheckedChanged
E.g CheckBoxEg.aspx :
/>
chkS S
/>
AutoPos
FYBCA Subjects
</asp:Panel>
SYBCA Subjects
</asp:Panel>
<asp:Panel
TYBCA Subjects
</asp:Panel>
CheckBoxEg.aspx.vb :
Partial Class CheckBoxEg
Inherits System.Web.UI.Page
Protected Sub chkFy_CheckedChanged (ByVal sender As object, ByVal e As
System.EventArgs) Handles chkFy.CheckedChanged
panFy.Visible = True
End Sub
End Class
lblF
Content.aspx.vb :-
Partial Class FileEg
Inherits System.Web.UI.Page
Protected Sub Fupload_Click (ByVal sender As object, ByVal e As
System.EventArgs) Handles Fupload.Click
Else
End If
End Sub
End Class
The Server.MapPath method traces the location of given path (images) where we
want to upload the given file (f1).
Then after the SaveAs method saves the file (uploads) on the mapped path on the
server.
Hyperlink Control :-
A hyperlink control is used to create a hyperlink in ASP.NET.
We can specify the hyperlink text using the text property.
We can also display an image instead of hyperlink by using ImageUrl property.
Properties of Hyperlink control :-
1. ImageUrl: Specifies the URL of the image to be displayed as a hyperlink.
2. NavigateUrl: Specifies the URL of the page to be navigated to.
3. Target: It specifies the target frame of the URL. (_blank, _parent, _top, _self)
Syntax :-
\
</asp:Hyperlink>