State Management of
Hidden Form Field_1
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HiddenField1.aspx.cs" Inherits="ASPNETALL.HiddenField1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td><h1>Hidden Form Field1</h1></td>
</tr>
<tr>
<td>User Name: <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Uesr Email:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Font-Bold="True" Text="HiddenField2" OnClick="Button1_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HiddenField1.aspx.cs" Inherits="ASPNETALL.HiddenField1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td><h1>Hidden Form Field1</h1></td>
</tr>
<tr>
<td>User Name: <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>Uesr Email:
<asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="Button1" runat="server" Font-Bold="True" Text="HiddenField2" OnClick="Button1_Click" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
HiddenField1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace ASPNETALL
{
public partial class HiddenField1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("HiddenField2.aspx");
}
public string Name
{
get
{
return txtName.Text;
}
}
public string Email
{
get
{
return txtEmail.Text;
}
}
}
}
0 comments
Post a Comment