controlsweb/label1.aspx

 

<html>

<head>

<title>Label Web Server Control</title>

</head>

<body style="font:14pt arial; background-color:beige; color:brown">

<h1> ASP.NET Label Web Server Control</h1>

<form ID="myForm" runat=server>

<asp:label id="myLabel" Text="Simple example of a label control!" runat="server" />

</form>

</body>

</html>

 

controlsweb/label2.aspx

 

<html>

<head><title>Testing the Label Web Server Control</title>

<script runat="server">

Sub Page_Load

lblHeader.Text="Testing the Label Web Server Control"

lblDate.Text="Today is: " & now()

End Sub

</script>

 

<html>

<body>

<h1 align=center>ASP.NET</h1>

<form runat="server">

<h2 align=center><asp:label id="lblHeader" runat="server" /></h2>

<h3 align=center><asp:label id="lblDate" runat="server" /></h3>

</form>

</body>

</html>

 

controlsweb/label2a.aspx

 

<html>

<head><title>Testing the Label Web Server Control</title>

<script runat="server">

Sub Page_Load(sender As Object, e As EventArgs)

lblHeader.Text="Testing the Label Web Server Control"

lblDate.Text="Today is: " & now()

End Sub

</script>

 

<html>

<body>

<h1 align=center>ASP.NET</h1>

<form runat="server">

<h2 align=center><asp:label id="lblHeader" runat="server" /></h2>

<h3 align=center><asp:label id="lblDate" runat="server" /></h3>

</form>

</body>

</html>

 

controlsweb/textbox1.aspx

 

<html>

<head>

<title>Textbox Web Server Control</title>

<script runat="server">

Sub NameSub(sender As Object, e As EventArgs)

lblGreet.text = "Hi, " & txtFst.text & " " & txtLast.text

End Sub

</script>

</head>

<body style="font: 12pt arial">

<h1 align=center>ASP.NET</h1>

<h2 align=center>Textbox Web Server Control</h2>

<form ID="NameForm" runat="server">

First Name <asp:TextBox id=txtFst ForeColor="blue" runat="server" />

Last Name <asp:TextBox id=txtLast ForeColor="red" runat="server" />

<asp:Button Text="Submit" OnClick="NameSub" runat="server" />

<asp:Label id=lblGreet ForeColor="green" runat="server" />

</form>

</body>

</html>

 

controlsweb/check1.aspx

 

<html>

<head><title>Make sentences using List Items</title>

<script runat="server">

Sub makeSentence(sender As Object, e As EventArgs)

dim ct

mySentence.Text="<p>Your sentence: </p>"

for ct =0 to phrases.Items.Count-1

if phrases.Items(ct).Selected then

mySentence.Text=mySentence.Text & " " & phrases.Items(ct).Text

end if

next

End Sub

</script>

<script runat="server">

Sub clear(Source As Object, e As EventArgs)

dim pt

for pt = 0 to phrases.Items.Count-1

if phrases.Items(pt).Selected then

phrases.Items(pt).Selected = False

end if

next

mySentence.Text=""

End Sub

</script>

</head>

<body>

<form runat="server">

<asp:CheckBoxList id="phrases" AutoPostBack="True"

TextAlign="Right" OnSelectedIndexChanged="makeSentence"

runat="server">

<asp:ListItem>The dog</asp:ListItem>

<asp:ListItem>The cat</asp:ListItem>

<asp:ListItem>The bird</asp:ListItem>

<asp:ListItem>The fish</asp:ListItem>

<asp:ListItem>The horse</asp:ListItem>

<asp:ListItem>ran</asp:ListItem>

<asp:ListItem>flew</asp:ListItem>

<asp:ListItem>swam</asp:ListItem>

<asp:ListItem>jumped</asp:ListItem>

<asp:ListItem>trotted</asp:ListItem>

<asp:ListItem>over the fence</asp:ListItem>

<asp:ListItem>onto the railing</asp:ListItem>

<asp:ListItem>into the rock</asp:ListItem>

<asp:ListItem>down the hill</asp:ListItem>

<asp:ListItem>into the tree</asp:ListItem>

<asp:ListItem>into the cage</asp:ListItem>

<asp:ListItem>up the stream</asp:ListItem>

</asp:CheckBoxList>

<asp:label id="mySentence" runat="server"/>

<br /><br />

<asp:Button id="clearButton" Text="Clear"

runat="server" OnClick="clear"/>

</form>

</body>

</html>

 

controlsweb/check1c.aspx

 

<html>

<head><title>Make sentences using List Items</title>

<script runat="server">

Sub makeSentence(sender As Object, e As EventArgs)

dim ct

mySentence.Text="<p>Your sentence: </p>"

for ct =0 to phrases.Items.Count-1

if phrases.Items(ct).Selected then

mySentence.Text=mySentence.Text & " " & phrases.Items(ct).Text

end if

next

End Sub

</script>

<script runat="server">

Sub clear(Source As Object, e As EventArgs)

dim pt

for pt = 0 to phrases.Items.Count-1

if phrases.Items(pt).Selected then

phrases.Items(pt).Selected = False

end if

next

mySentence.Text=""

End Sub

</script>

</head>

<body>

<form runat="server">

<asp:CheckBoxList id="phrases" AutoPostBack="True"

TextAlign="Right" OnSelectedIndexChanged="makeSentence"

RepeatColumns=3 RepeatDirection=Vertical runat="server">

<asp:ListItem>The dog</asp:ListItem>

<asp:ListItem>The cat</asp:ListItem>

<asp:ListItem>The bird</asp:ListItem>

<asp:ListItem>The fish</asp:ListItem>

<asp:ListItem>The horse</asp:ListItem>

<asp:ListItem>The duck</asp:ListItem>

<asp:ListItem>The elephant</asp:ListItem>

<asp:ListItem>ran</asp:ListItem>

<asp:ListItem>flew</asp:ListItem>

<asp:ListItem>swam</asp:ListItem>

<asp:ListItem>jumped</asp:ListItem>

<asp:ListItem>trotted</asp:ListItem>

<asp:ListItem>lumbered</asp:ListItem>

<asp:ListItem>walked</asp:ListItem>

<asp:ListItem>over the fence</asp:ListItem>

<asp:ListItem>onto the railing</asp:ListItem>

<asp:ListItem>into the rock</asp:ListItem>

<asp:ListItem>down the hill</asp:ListItem>

<asp:ListItem>into the tree</asp:ListItem>

<asp:ListItem>into the cage</asp:ListItem>

<asp:ListItem>up the stream</asp:ListItem>

</asp:CheckBoxList>

<asp:label id="mySentence" runat="server"/>

<br /><br />

<asp:Button id="clearButton" Text="Clear"

runat="server" OnClick="clear"/>

</form>

</body>

</html>

 

controlsweb/table1.aspx

 

<html>

<head><title>Table</title>

</head>

<body>

<form runat="server">

<asp:Table runat="server" id="flyPrice" BorderWidth=3

CellPadding=5 CellSpacing=5

GridLines="both" HorizontalAlign="Left">

<asp:TableRow>

<asp:TableCell>Fare Table</asp:TableCell>

<asp:TableCell>From Boston</asp:TableCell>

<asp:TableCell>From NY</asp:TableCell>

<asp:TableCell>From DC</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To London</asp:TableCell>

<asp:TableCell>199</asp:TableCell>

<asp:TableCell>189</asp:TableCell>

<asp:TableCell>195</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To San Francisco</asp:TableCell>

<asp:TableCell>245</asp:TableCell>

<asp:TableCell>230</asp:TableCell>

<asp:TableCell>295</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To Baku</asp:TableCell>

<asp:TableCell>535</asp:TableCell>

<asp:TableCell>500</asp:TableCell>

<asp:TableCell>490</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To Oslo</asp:TableCell>

<asp:TableCell>420</asp:TableCell>

<asp:TableCell>380</asp:TableCell>

<asp:TableCell>410</asp:TableCell>

</asp:TableRow>

</asp:Table>

</form>

</body>

</html>

 

controlsweb/table2.aspx

 

<html>

<head><title>Table</title>

<script runat="server">

Sub getFare(sender As Object, e As EventArgs)

dim strFare as string

dim intFromIndx as integer

dim intToIndx as integer

dim objRow as TableRow

dim objCell as TableCell

intFromIndx = fromCity.SelectedIndex

intToIndx = toCity.SelectedIndex

objRow = flyPrice.Rows.Item(intToIndx+1)

objCell = objRow.Cells.Item(intFromIndx+1)

strFare = objCell.Text

yourFare.Text="Your fare is: " & strFare

End Sub

</script>

</head>

<body>

<form runat="server">

<asp:RadioButtonList id="fromCity" runat="server">

<asp:ListItem selected="true">From Boston</asp:ListItem>

<asp:ListItem>From NY</asp:ListItem>

<asp:ListItem>From DC</asp:ListItem>

</asp:RadioButtonList>

<asp:RadioButtonList id="toCity" runat="server">

<asp:ListItem selected="true">To London</asp:ListItem>

<asp:ListItem>To San Francisco</asp:ListItem>

<asp:ListItem>To Baku</asp:ListItem>

<asp:ListItem>To Oslo</asp:ListItem>

</asp:RadioButtonList>

<asp:Table runat="server" id="flyPrice" BorderWidth=3

CellPadding=5 CellSpacing=5

GridLines="both" HorizontalAlign="Left">

<asp:TableRow>

<asp:TableCell>Fare Table</asp:TableCell>

<asp:TableCell>From Boston</asp:TableCell>

<asp:TableCell>From NY</asp:TableCell>

<asp:TableCell>From DC</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To London</asp:TableCell>

<asp:TableCell>197</asp:TableCell>

<asp:TableCell>189</asp:TableCell>

<asp:TableCell>195</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To San Francisco</asp:TableCell>

<asp:TableCell>245</asp:TableCell>

<asp:TableCell>230</asp:TableCell>

<asp:TableCell>295</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To Baku</asp:TableCell>

<asp:TableCell>535</asp:TableCell>

<asp:TableCell>500</asp:TableCell>

<asp:TableCell>490</asp:TableCell>

</asp:TableRow>

<asp:TableRow>

<asp:TableCell>To Oslo</asp:TableCell>

<asp:TableCell>420</asp:TableCell>

<asp:TableCell>380</asp:TableCell>

<asp:TableCell>410</asp:TableCell>

</asp:TableRow>

</asp:Table>

<br /><br />

<asp:Button text="Get Fare" OnClick="getFare" runat="server"/>

<br /><br />

<asp:label id="yourFare" runat="server"/>

</form>

</body>

</html>