KEMBAR78
Dotnet Programs | PDF | Data Management | System Software
0% found this document useful (0 votes)
9 views45 pages

Dotnet Programs

The document contains several ASP.NET web forms for job seeker registration, email registration, data display using GridView, file upload, state management, session and view state handling, and a college portal. Each section includes source code for the front-end and back-end, detailing form elements, validation, and database interactions. The document serves as a comprehensive guide for creating various web applications using ASP.NET.

Uploaded by

tn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views45 pages

Dotnet Programs

The document contains several ASP.NET web forms for job seeker registration, email registration, data display using GridView, file upload, state management, session and view state handling, and a college portal. Each section includes source code for the front-end and back-end, detailing form elements, validation, and database interactions. The document serves as a comprehensive guide for creating various web applications using ASP.NET.

Uploaded by

tn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 45

1.

JOB SEEKER

Source code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"


Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 70%;
margin-right: 0px;
}
.style2
{
height: 23px;
}
.style3
{
height: 23px;
width: 271px;
}
.style4
{
width: 271px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td class="style3">
Name</td>
<td class="style2">
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox> </td>
</tr>
<tr>
<td class="style3">
age</td> <td
class="style2">
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style4">
qualification</td> <td>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style4">
address</td>
<td>
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style4">
phone no</td>
<td>
<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style3">
email id</td> <td
class="style2">
<asp:TextBox ID="TextBox6"
runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td class="style4">
father name</td>
<td>
<asp:TextBox ID="TextBox7"
runat="server"></asp:TextBox>
</td>
</tr>
</table>
</div>
<asp:Button ID="Button1" runat="server" Text="Submit" />
<p>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
</form>
</body>
</html>

CONNECTION CODE:

Partial Class _Default


Inherits System.Web.UI.Page

Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles


Me.Load
End Sub

Protected Sub Button1_Click(sender As Object, e As System.EventArgs)


Handles Button1.Click
Label1.Text = "submitted successfully"
End sub
End Class
Design page:
OUTPUT:
2.EMAIL REGISTRATION
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
height: 23px;
}
.style3
{
width: 399px;
}
.style4
{ height:
23px;
width: 399px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style3">
First Name</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
runat="server"
ControlToValidate="TextBox1" ErrorMessage="enter
name"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style4">
Last Name</td>
<td class="style2">
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2"
runat="server"
ControlToValidate="TextBox2" ErrorMessage="enter last
name"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
User Name</td>
<td>
<asp:TextBox ID="TextBox3"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="TextBox3" ErrorMessage="enter
username"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
Password</td>
<td>
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator4"
runat="server"
ControlToValidate="TextBox4" ErrorMessage="enter
password"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="style3">
Re-password</td>
<td>
<asp:TextBox ID="TextBox5"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5"
runat="server"
ControlToValidate="TextBox5" ErrorMessage="enter
password again"></asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator1" runat="server"
ControlToCompare="TextBox4" ControlToValidate="TextBox5"
ErrorMessage="not match"></asp:CompareValidator>
</td>
</tr>
<tr>
<td class="style3">
email id</td>
<td>
<asp:TextBox ID="TextBox6"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator6"
runat="server"
ControlToValidate="TextBox6" ErrorMessage="enter
email"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox6" ErrorMessage="invalid"
ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\
w+([-
.]\w+)*"></asp:RegularExpressionValidator>
</td>
</tr>
<tr>
<td class="style3">
age</td>
<td>
<asp:TextBox ID="TextBox7"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7"
runat="server"
ControlToValidate="TextBox7" ErrorMessage="enter
age"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="TextBox7" ErrorMessage="not eligible"
MaximumValue="35"
MinimumValue="18"></asp:RangeValidator>
</td>
</tr>
</table>
<asp:Button ID="Button1" runat="server" Text="Submit" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</p>
</form>
</body>
</html>

Connection code:

Partial Class _Default


Inherits System.Web.UI.Page

Protected Sub Button1_Click(sender As Object, e As System.EventArgs)


Handles
Button1.Click
Label1.Text = "successfully submitted"
End Sub
End Class
Design page:

Output:
3.GRID VIEW
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:GridView ID="GridView1" runat="server"


AutoGenerateColumns="False"
DataKeyNames="ID" DataSourceID="AccessDataSource1">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID"
ReadOnly="True"
SortExpression="ID" />
<asp:BoundField DataField="name" HeaderText="name"
SortExpression="name" />
<asp:BoundField DataField="age" HeaderText="age"
SortExpression="age" />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/nab3.mdb" SelectCommand="SELECT * FROM [grid]">
</asp:AccessDataSource>
</div>
</form>
</body>
</html>
Design page:

Output:
4.SERVER SIDE CONTROL:
SOURCE CODE:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:FileUpload ID="FileUpload1" runat="server" />


<hr />
<asp:Button ID="Button1" Text="Upload" runat="server"
OnClick="UploadFile" />
<hr />
<asp:Label ID="lb1" runat="server"></asp:Label>
</div>
</form>
</body>
</html>

CONNECTION CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;

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


{
protected void UploadFile (object sender, EventArgs e)
{
string folderpath = Server.MapPath("~/Files/");
if(!Directory.Exists(folderpath))
{
Directory.CreateDirectory(folderpath);
}
FileUpload1.SaveAs(folderpath
+Path.GetFileName(FileUpload1.FileName));
lb1.Text= Path.GetFileName(FileUpload1.FileName)+"has been
uploaded";
}
}

Design page:

OUTPUT:
5.state management :
SOURCE CODE:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="counter.aspx.cs"
Inherits="counter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click"


Text="samepage" />

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

CONNECTION CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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


{
private int _counter;
protected void Page_Load(object sender, EventArgs e)
{
_counter = Convert.ToInt16(ViewState["mycounter"]);
}
protected void Button1_Click(object sender, EventArgs e)
{
_counter++;
ViewState["mycounter"] = _counter;
Response.Write(_counter);

}
OUTPUT:
6.session and view state :

SOURCE CODE:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="counter.aspx.cs"
Inherits="counter" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Button ID="Button1" runat="server" onclick="Button1_Click"


Text="samepage" />
<asp:Button ID="Button2" runat="server" onclick="Button2_Click"
Text="otherpage" />

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

CONNECTION CODE FOR SAME PAGE:(VIEW STATE)


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

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


{
private int _counter;
protected void Page_Load(object sender, EventArgs e)
{
_counter = Convert.ToInt16(ViewState["mycounter"]);
}
protected void Button1_Click(object sender, EventArgs e)
{
_counter++;
ViewState["mycounter"] = _counter;
Response.Write(_counter);

}
protected void Button2_Click(object sender, EventArgs e)
{
Session["value"] = "welcome";
Response.Redirect("otherpage.aspx");
}
}

CONNECTION CODE FOR OTHER PAGE:(SESSION


STATE)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="other page.aspx.cs"
Inherits="other_page" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body bgcolor="aqua">
<p>session state</p>
<form id="form1" runat="server">
<div>

</div>
</form>
</body>
</html>
Output:
7.COLLEGE PORTAL:
CONNECTION CODE:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace fahima
{
public partial class Form1 : Form
{
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\ACER
UZER 2023\Documents\std.mdb");
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
con.Open();
OleDbCommand cmd=new OleDbCommand("insert into table1
Values("+textBox1.Text+",'"+textBox2.Text+"','"+textBox3.Text+"')",con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("successfully");
fillgrid();
}
void fillgrid()
{
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select * from
Table1", con);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}

private void button2_Click(object sender, EventArgs e)


{
con.Open();
OleDbCommand cmd = new OleDbCommand("delete from Table1 where
sid="+textBox1.Text+"",con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("successfully");
fillgrid();
}

private void button3_Click(object sender, EventArgs e)


{
con.Open();
OleDbCommand cmd = new OleDbCommand("update Table1 set sname=
'"+ textBox2.Text +"' where sid="+textBox1.Text+"",con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("successfully");
fillgrid();
}
}
}
Design page:
OUTPUT:
8.WORKING WITH PAGE
Source code:

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body bgcolor="lime">
<form id="form1" runat="server">
<div>
<h1>first page</h1>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
Text="link to page2" />

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

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body bgcolor="fuchsia">
<form id="form1" runat="server">
<div>
<h1>welcome to second page</h1>
</div>
</form>
</body>
</html>
Connection code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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


{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect("default3.aspx");
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("default2.aspx");
}
}
Output:
9.master page:

Source code:
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div class="head"
style="font-family: 'Bookman Old Style'; font-size: medium;
font-weight: lighter; font-style: italic; font-variant: inherit; text-
transform: capitalize; color: #000066">
header</div>
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

<p>
&nbsp;</p>

</asp:ContentPlaceHolder>
<div class="foot" style="font-family: Amiri; font-size: medium;
font-weight: bold; font-style: oblique; font-variant: small-caps; text-
transform: uppercase; color: #993300">
footer
</div>

</form>
</body>
</html>
Skin file:
<%--
Default skin template. The following skins are provided as examples only.

1. Named control skin. The SkinId should be uniquely defined because


duplicate SkinId's per control type are not allowed in the same theme.

<asp:GridView runat="server" SkinId="gridviewSkin" BackColor="White" >


<AlternatingRowStyle BackColor="Blue" />
</asp:GridView>

2. Default skin. The SkinId is not defined. Only one default


control skin per control type is allowed in the same theme.

<asp:Image runat="server" ImageUrl="~/images/image1.jpg" />


--%>
<asp:Button runat="server" BorderColor="#000066" />

Stylesheet:
body
{
background-color:Fuchsia;
}
.head
{
background-color:Lime;
}
.foot
{
background-color:Aqua;
}
Design page:

Output:
10.AD ROTATOR:

SOURCE CODE:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:AdRotator ID="AdRotator1" runat="server"


AdvertisementFile="~/XMLFile.xml" />

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

XML FILE CODE:


<?xml version="1.0" encoding="utf-8" ?>
<adveristment>
<AD>
<imageurl>~\image\screenshot(1)\</imageurl>

</AD>
<AD>
<imageurl>~\image\screenshot(2)\</imageurl>
</AD>
<AD>
<imageurl>~\image\screenshot(3)\</imageurl>
</AD>
</adveristment>
Design page:

OUTPUT:
11.ADO.NET:
CONNECTION CODE:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace ADOnet
{
public partial class Form1 : Form
{
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\ACER
UZER 2023\Documents\ado.mdb");
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
con.Open();
OleDbCommand cmd = new OleDbCommand("insert into table1 values("
+ textBox1.Text + ",'" + textBox2.Text + "','" + textBox3.Text + "')", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("insert successfully");
fillgrid();
}
void fillgrid()
{
con.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select *from
table1", con);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
con.Close();
}

private void button2_Click(object sender, EventArgs e)


{
con.Open();
OleDbCommand cmd = new OleDbCommand("delete from table1 where
eid=" + textBox1.Text + "", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("delete successfully");
fillgrid();
}

private void button3_Click(object sender, EventArgs e)


{
con.Open();
OleDbCommand cmd = new OleDbCommand("update table1 set ename='"
+ textBox2.Text + "' where eid=" + textBox1.Text + "", con);
cmd.ExecuteNonQuery();
con.Close();
MessageBox.Show("updated successfully");
fillgrid();

}
}
}
DESIGN PAGE:
Output:

12. form:
Source code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"


"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.style1
{
width: 100%;
}
.style2
{
width: 361px;
}
.style3
{
width: 361px;
height: 23px;
}
.style4
{
height: 23px;
}
.style5
{
width: 361px;
height: 25px;
}
.style6
{
height: 25px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<table class="style1">
<tr>
<td class="style3">
<asp:Label ID="Label1" runat="server"
Text="name"></asp:Label>
</td>
<td class="style4">
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
enter name</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="Label2" runat="server"
Text="DOB"></asp:Label>
</td>
<td class="style4">
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
enter dob</td>
</tr>
<tr>
<td class="style3">
<asp:Label ID="Label3" runat="server"
Text="address"></asp:Label>
</td>
<td class="style4">
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
enter address</td>
</tr>
<tr>
<td class="style5">
gender</td>
<td class="style6">
<asp:RadioButton ID="RadioButton1" runat="server"
GroupName="gender"
Text="male" />
<asp:RadioButton ID="RadioButton2" runat="server"
GroupName="gender"
Text="female" />
&nbsp;enter gender
</td>
</tr>
<tr>
<td class="style2">
phone no</td>
<td>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
enter phone no</td>
</tr>
<tr>
<td class="style2">
blood group</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox>
enter blood group</td>
</tr>
<tr>
<td class="style2">
marital status</td>
<td>
<asp:RadioButton ID="RadioButton3" runat="server"
GroupName="marital status"
Text="married" />
<asp:RadioButton ID="RadioButton4" runat="server"
GroupName="marital status"
Text="unmarried" />
&nbsp;enter marital status</td>
</tr>
<tr>
<td class="style2">
state</td>
<td>
<asp:TextBox ID="TextBox8" runat="server"></asp:TextBox>
enter state</td>
</tr>
</table>
<div>

</div>
<asp:Button ID="Button1" runat="server" Text="submit" />
<p>
<asp:Label ID="Label4" runat="server" Text="label"></asp:Label>
</p>
</form>
</body>
</html>

Connection code:
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Button1_Click(sender As Object, e As System.EventArgs)


Handles Button1.Click
Label4.Text = "submitted successfully"

End Sub
End Class
Design page:

Output:

You might also like