Write below code in the default.aspx
<%@ 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:Label ID="Label1" width=300px align=center runat="server" Text="First Name: "
style="color: #FF0066"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label2" width=300px align=center runat="server" Text="Last Name: " style="color: #FF0066"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label3" width=300px align=center runat="server" Text="Email ID:" style="color: #FF0066"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label4" width=300px align=center runat="server" Text="Password: " style="color: #FF0066"></asp:Label>
<asp:TextBox ID="TextBox4" TextMode="Password" runat="server"></asp:TextBox>
<br />
<asp:Label ID="Label5" width=300px align=center runat="server" Text="Confirm Password: "
style="color: #FF0066"></asp:Label>
<asp:TextBox ID="TextBox5" TextMode="Password" runat="server"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" align=center runat="server" Text="Button" onclick="Button1_Click"
style="color: #FF0066" />
<br />
<br />
<asp:Label ID="Label7" runat="server" style="color: #FF0066"></asp:Label>
<br />
<asp:Label ID="Label8" runat="server" style="color: #FF0066"></asp:Label>
<br />
<asp:Label ID="Label9" runat="server" style="color: #FF0066"></asp:Label>
<br />
<asp:Label ID="Label10" runat="server" style="color: #FF0066"></asp:Label>
</div>
</form>
</body>
</html>
Then view this code in design tab.
Double click on the button.
Default.aspx.cs file will open.
write the following code in it :-
protected void Button1_Click(object sender, EventArgs e)
{
Label7.Text = "Your First Name is : "+ TextBox1.Text;
Label8.Text = "Your Last name is : " + TextBox2.Text;
Label9.Text = "Your Email id is : " + TextBox3.Text;
Label10.Text = "Password secret chhe sir";
Label11.Text = "You are " + DropDownList1.SelectedItem;
}
No comments:
Post a Comment