I m working with hidden field
I want to display the first page data in second page using hiddenfield
first.aspx
<body>
<form id="form1" runat="server">
Name:<asp:TextBox ID="txtname" runat="server"></asp:TextBox><br />
Address:<asp:TextBox ID="txtaddress" runat="server"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" Text="Next" OnClick="Button1_Click" style="height: 26px" />
<asp:HiddenField ID="hdnname" runat="server" />
<asp:HiddenField ID="hdaddress" runat="server" />
</form>
</body>
first.aspx.cs
public partial class DemoHidden : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
hdnname.Value = txtname.Text;
hdaddress.Value = txtaddress.Text;
}
protected void Button1_Click(object sender, EventArgs e)
{
}
}
second.aspx
<body>
<form id="form1" runat="server">
nameget:<asp:Label ID="lblname" runat="server" Text="Label"></asp:Label><br />
addressget:<asp:Label ID="lbladdress" runat="server" Text="Label"></asp:Label>
</form>
</body>
second.aspx.cs
public partial class Second : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
//lblname.Text=txtname //here I want to display the name and addresss
}
}
how to display the name and address when user fill up the first webform and display data in second webform page using hiddenfield?
help?