ASP. NET Journal
ASP. NET Journal
NET TYBCA-3
Q.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:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td><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 class="style5">
<asp:RadioButtonList ID="radio_gender" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</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>Travelling</asp:ListItem>
<asp:ListItem>Dancing</asp:ListItem>
<asp:ListItem>Reading</asp:ListItem>
<asp:ListItem>Drawing</asp:ListItem>
</asp:CheckBoxList>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnsubmit" runat="server" Text="Submit"
onclick="btnsubmit_Click" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
height: 23px;
}
.style2
{
height: 23px; width: 123px;
}
.style3
{
width: 123px;
}
.style4
{
width: 125px;
}
.style5
{
width: 125px; height: 23px;
}
.style6
{
Inherits System.Web.UI.Page
lbname.Text = txtname.Text
lbage.Text = txtage.Text
lbadd.Text = txtadd.Text
lbno.Text = txtno.Text
lbemail.Text = txtemail.Text
End Sub
End Class
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1 { height: 26px;
}
.style2
{
height: 26px; width: 373px;
}
.style3
{
width: 373px;
}
</style>
<td class="style3">
<asp:RadioButtonList ID="radio_gender" runat="server">
<asp:ListItem>Male</asp:ListItem>
<asp:ListItem>Female</asp:ListItem>
</asp:RadioButtonList>
</td>
</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" onclick="btnsubmit_Click" />
<asp:Button ID="btnreset" runat="server" Text="Reset" onclick="btnreset_Click" /></td>
</tr>
<tr>
<td colspan="2">
<asp:Panel ID="Panel1" runat="server" Visible="False">
<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 />
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Select your
birthday"></asp:Label>
</td>
<td>
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
</td>
</tr>
</table>
<asp:Panel ID="Panel1" runat="server" Visible="false">
<table>
<tr>
<td>
Output:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<asp:FileUpload ID="fileupload1" runat="server" />
<br />
<br />
<asp:Button ID="btnsub" runat="server" Text="Submit" onclick="btnsub_Click" />
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
Output:
Desing:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Id:"></asp:Label>
</td>
<td>
<asp:TextBox ID="tbid" runat="server"></asp:TextBox>
</td>
<td>
<asp:Button ID="btnsearch" runat="server" Text="Search" />
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Name:"></asp:Label>
</td>
End Sub
End Sub
End Sub
Output:
UPDATED
VIEW