0% found this document useful (0 votes)
27 views

Practical 2

The document describes a registration form created with ASP.NET that includes fields for user information like name, address, gender, state, city, email and phone number. The form uses web controls like TextBox, RadioButton, DropDownList and Button. When the Submit button is clicked, the code behind concatenates the first name textbox value to a label for display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Practical 2

The document describes a registration form created with ASP.NET that includes fields for user information like name, address, gender, state, city, email and phone number. The form uses web controls like TextBox, RadioButton, DropDownList and Button. When the Submit button is clicked, the code behind concatenates the first name textbox value to a label for display.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Practical 2

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PRAC3.aspx.cs" Inherits="PRAC3"


%>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">

.auto-style4 {
text-align: center;
}
.newStyle6 {
font-style: normal;
font-size: x-large;
}
.newStyle2 {
background-color: #3366CC;
}
.auto-style9 {
font-size: larger;
font-style: inherit;
font-weight: bold;
font-variant: normal;
color: #000040;
width: 136px;
}
.newStyle4 {
font-size: larger;
font-style: inherit;
font-weight: bold;
font-variant: normal;
color: #000040;
}
.auto-style5 {
width: 136px;
text-align: left;
}
.auto-style3 {
width: 308px;
margin-left: 40px;
}
.auto-style8 {
width: 308px;
margin-left: 40px;
text-align: left;
}
.auto-style6 {
width: 136px;
height: 26px;
text-align: left;
}
.auto-style7 {
width: 308px;
margin-left: 40px;
height: 26px;
text-align: left;
}
.auto-style2 { height: 54px;
text-align: left;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>

<H3 class="auto-style4"><span class="newStyle6">Registration Form</span></H3>


<table class="newStyle2" align="center">
<tr>
<td class="auto-style9">First Name :</td>
<td class="newStyle4">
<asp:TextBox ID="TextBox9" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Middle Name :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Last Name :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Address : </td>
<td class="auto-style8">
<textarea id="TextArea1" cols="20" name="S1" rows="2"></textarea></td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Gender :</td>
<td class="auto-style3">
<asp:RadioButton ID="RadioButton1" runat="server" Text="Male" />
&nbsp;<asp:RadioButton ID="RadioButton2" runat="server" Text="Female" />
&nbsp;<asp:RadioButton ID="RadioButton3" runat="server" Text="Others" />
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style6">State :</td>
<td class="auto-style7">
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Gujarat</asp:ListItem>
<asp:ListItem>Rajasthan</asp:ListItem>
<asp:ListItem>Mumbai</asp:ListItem>
<asp:ListItem>Pune</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">City :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Pincode :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">E-Mail :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style5">Phone No. :</td>
<td class="auto-style3">
<asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
</td>
</tr>
<tr class="newStyle4">
<td class="auto-style2"
colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Submit " />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</td>

</tr>
</table>
<br />
<br />
<br />
<br />

</div>
</form>
</body>
</html>

Code Behind:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class PRAC3 : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("HELLO! WE ARE GPG STUDENTS");
}
protected void Button1_Click(object sender, EventArgs e)
{

Label1.Text = "HELLO !" + TextBox9.Text;

}
}

You might also like