PRIT ASP.NET
PRIT ASP.NET
NET TYBCA_SEM-5
1. Create The Registration Form Using Tabular Format And When User
Submit The Form Display Data In A Separate Panel On The Same
Page.
Design :
Code:
Prg1.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="prg1.aspx.vb"
Inherits="prg1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1 {
height: 26px;
}
.style2
{
height: 26px;
width: 629px;
}
.style3
{
width: 629px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td align="center" colspan="2"><h1>Students Information</h1></td>
</tr>
<tr>
<td class="style1">
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
</td>
<td class="style2">
<asp:TextBox ID="txtname" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="E-mail"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtemail" runat="server"></asp:TextBox></td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtaddress" runat="server"
TextMode="MultiLine"></asp:TextBox></td>
</tr>
<tr>
<td><asp:Label ID="Label4" runat="server" Text="Password"></asp:Label></td>
<td class="style3">
2
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</tr>
<tr>
<td style="font-size: small">
<asp:Label ID="Label6" runat="server" Text="Hobby"></asp:Label></td>
<td class="style3">
<asp:CheckBoxList ID="chkbox_hobby" runat="server">
<asp:ListItem>Cricket</asp:ListItem>
<asp:ListItem>Hockey</asp:ListItem>
<asp:ListItem>Football</asp:ListItem>
<asp:ListItem>Volleyball</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnsubmit" runat="server" Text="Submit" ForeColor="Black"
Height="50px" Width="100px" />
3
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Width="955px">
<asp:Label ID="Label7" runat="server"
Text="Name"></asp:Label>
<asp:Label ID="lblname" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label8" runat="server"
Text="Email"></asp:Label>
<asp:Label ID="lblemail" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label9" runat="server"
Text="Address"></asp:Label>
<asp:Label ID="lbladdress" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label10" runat="server"
Text="Gender"></asp:Label>
<asp:Label ID="lblgender" runat="server" Text="Label"></asp:Label><br />
<asp:Label ID="Label11" runat="server"
Text="Hobby"></asp:Label>
<asp:Label ID="lblhobby" runat="server" Text="Label"></asp:Label>
</asp:Panel>
</td>
</tr>
</table>
</div>
</form>
</body> </html>
Prg1.aspx.vb :
4
DAVE PRITA.
ASP.NET TYBCA_SEM-5
5
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Code:
Prg2.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="prg2.aspx.vb"
Inherits="prg2" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
height: 23px;
width: 118px;
}
.style2
{
width: 118px;
}
.style3
6
DAVE PRITA.
ASP.NET TYBCA_SEM-5
{
width: 629px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<th class="style1" > Select Stream</th>
<tr>
<td class="style2">Stream</td>
<td class="style3">
<asp:RadioButtonList ID="rdstream" runat="server" AutoPostBack="True">
<asp:ListItem Text="BCA" Value="BCA" />
<asp:ListItem Text="BBA" Value="BBA" />
<asp:ListItem Text="BCOM" Value="BCOM" />
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td colspan="2">
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
7
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</asp:Panel>
</td>
</tr>
<tr>
<td colspan="2">
</asp:Panel>
</td>
</tr>
</table>
</div>
</form>
</body> </html>
Prg2.aspx.vb :
End If
Next
End Sub
Output :
9
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Code:
multiviewpage.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="mutliviewpage.aspx.vb"
Inherits="mutliviewpage" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
height: 23px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
10
DAVE PRITA.
ASP.NET TYBCA_SEM-5
<table colspan="5">
<tr>
<td>name</td>
<td> <asp:TextBox ID="txtname" runat="server"></asp:TextBox>
<br />
</td></tr>
<tr>
<td>
age</td>
<td>
<asp:TextBox ID="txtage" runat="server"></asp:TextBox>
<br />
</td></tr>
<tr>
<td>
address</td>
<td>
<asp:TextBox ID="txtaddress" runat="server"></asp:TextBox>
<br />
</td></tr>
<tr>
<td>
<asp:Button ID="btnnext" runat="server" Text=">" />
</td> </tr>
</table>
</asp:View>
<asp:View ID="View2" runat="server">
<table>
<tr>
<td> phone</td>
<td><asp:TextBox ID="txtphone" runat="server"></asp:TextBox>
<br /></td></tr>
<tr>
<td>
email</td>
<td> <asp:TextBox ID="txtemail" runat="server"></asp:TextBox>
<br /></td>
</tr>
<tr>
<td>
<asp:Button ID="btnnext1" runat="server" Text="<" /></td>
<td> <asp:Button ID="btnprev" runat="server" Text=">" /></td>
</tr>
</table>
11
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</asp:View>
<asp:View ID="View3" runat="server">
<center>
<h1>
summery</h1>
</center>
<table>
<tr><td>name</td>
<td>
<asp:Label ID="lblname" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td class="style1" >
age</td>
12
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</td>
</tr>
</table>
</asp:View>
</asp:MultiView>
</div>
</form>
</body>
</html>
multiviewpage.
aspx.vb :
13
DAVE PRITA.
ASP.NET TYBCA_SEM-5
lblage.Text = txtage.Text
lbladd.Text = txtaddress.Text
lblphone.Text = txtphone.Text
lblemail.Text = txtemail.Text
Class Output :
14
DAVE PRITA.
ASP.NET TYBCA_SEM-5
4. Create The Registration Form Using Tabular Format And When User
Submit The Form Display Data In A Separate Panel On The Same Page.
Also Apply All The Equired Validation Controls And Display Appropriate
Message.
Design :
Code:
Prg4.aspx :
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<style type="text/css">
.style1 {
height: 26px;
}
15
DAVE PRITA.
ASP.NET TYBCA_SEM-5
.style2
{
height: 26px;
width: 540px; }
.style3
{
width: 540px;
}
.style4
{
height: 48px;
}
.style5
{
width: 540px;
height: 48px;
}
.style6
{
height: 32px;
}
.style7
{
width: 540px;
height: 32px;
}
</style>
<script type="text/javascript" language="javascript">
function checkpasslen(sender, args) { if
(args.Value.Length < 8) args.IsValid = False;
else
args.IsValid = True;
}
</script> </head>
<body>
<form id="form1" runat="server">
<div>
<table style="height: 496px; width: 545px">
<tr>
<td align="center" colspan="2"><h1>Students Information</h1></td>
</tr>
<tr>
<td class="style1">
<asp:Label ID="Label1" runat="server" Text="Name"></asp:Label>
</td>
16
DAVE PRITA.
ASP.NET TYBCA_SEM-5
<td class="style2">
<asp:TextBox ID="txtname" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="Name is Required" ControlToValidate="txtname"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="E-mail"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtemail" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ErrorMessage="email is Required" ControlToValidate="txtemail"
ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style4">
<asp:Label ID="Label3" runat="server" Text="Address"></asp:Label></td>
<td class="style5">
<asp:TextBox ID="txtaddress" runat="server"
TextMode="MultiLine"></asp:TextBox> <asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ErrorMessage="address is Required" ControlToValidate="txtaddress"
ForeColor="Red"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td><asp:Label ID="Label19" runat="server" Text="Age"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtage" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
ErrorMessage="age is Required" ControlToValidate="txtage"
ForeColor="Red"></asp:RequiredFieldValidator>
<br />
&nbs
p; &n
bsp;
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="txtage" ErrorMessage="Age Must be Greater than 18"
ForeColor="Red" MaximumValue="100" MinimumValue="18"
Type="Integer"></asp:RangeValidator>
17
DAVE PRITA.
ASP.NET TYBCA_SEM-5
<br />
</td>
</tr>
<tr>
<td class="style6"><asp:Label ID="Label4" runat="server"
Text="Password"></asp:Label></td>
<td class="style7">
<asp:TextBox ID="txtpwd" runat="server"
TextMode="Password"></asp:TextBox>
<asp:CustomValidator ID="CustomValidator2" runat="server"
ControlToValidate="txtpwd" ClientValidationFunction="checkpasslen"
ErrorMessage="password must contains 8 charcters"
ValidateEmptyText="true"
ForeColor="Red"></asp:CustomValidator>
</td>
</tr>
<tr>
<td><asp:Label ID="Label12" runat="server" Text="Confirm
Password"></asp:Label></td>
<td class="style3">
<asp:TextBox ID="txtcpwd" runat="server"
TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
ErrorMessage="confirm password is Required" ControlToValidate="txtcpwd"
ForeColor="Red"></asp:RequiredFieldValidator>
<br />
&nbs
p; &n
bsp;
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="txtpwd" ControlToValidate="txtcpwd"
ErrorMessage="Password and Confirm password must be same"
ForeColor="Red"></asp:CompareValidator>
</td>
</tr>
<tr>
<td><asp:Label ID="Label5" runat="server" Text="Gender"></asp:Label></td>
<td class="style3">
<asp:RadioButtonList ID="radio_gender" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td>
18
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</tr>
<tr>
<td style="font-size: small">
<asp:Label ID="Label6" runat="server" Text="Hobby"></asp:Label></td>
<td class="style3">
<asp:CheckBoxList ID="chkbox_hobby" runat="server">
<asp:ListItem>Cricket</asp:ListItem>
<asp:ListItem>Hockey</asp:ListItem>
<asp:ListItem>Football</asp:ListItem>
<asp:ListItem>Volleyball</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnsubmit" runat="server" Text="Submit" />
19
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</form>
</body> </html>
Prg4.aspx.vb :
End Sub
Protected Sub btnreset_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles btnreset.Click
txtname.Text = ""
txtemail.Text = ""
txtaddress.Text = ""
txtpwd.Text = "" txtcpwd.Text
= ""
radio_gender.ClearSelection()
chkbox_hobby.ClearSelection()
End Sub
Protected Sub CustomValidator2_ServerValidate(ByVal source As Object, ByVal args As
System.Web.UI.WebControls.ServerValidateEventArgs) Handles
CustomValidator2.ServerValidate
20
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Output :
21
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Code:
Prg5.aspx :
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="prg5.aspx.vb"
Inherits="prg5" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>Select Your Birthdate</h3>
<asp:Calendar ID="calBirthDate" runat="server"
OnSelectionChanged="Calendar1_SelectionChanged" ></asp:Calendar>
<br />
<br />
<asp:Label ID="outputdate" runat="server" Text=""></asp:Label>
</div>
</form>
22
DAVE PRITA.
ASP.NET TYBCA_SEM-5
</body>
</html>
Prg5.aspx.vb :
23
DAVE PRITA.
ASP.NET TYBCA_SEM-5
Design :
Code:
Prg6.aspx :
<%@ Page Language="VB" %>
<script runat="server">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
24
DAVE PRITA.
ASP.NET TYBCA_SEM-5
25
DAVE PRITA.