I need to pass data between pages using ASP.NET C#, I need to get text value from first page to second page inside a TextBox using HttPost. My pages structure is given below I have Two(2) pages as given below:
WebForm1.aspx
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtData" runat="server"></asp:TextBox>
<br />
<asp:Button ID="btnHttpPost" runat="server" Text="HTTPPost" PostBackUrl="~/WebForm2.aspx" />
</div>
</form>
WebForm2.aspx
<form id="form1" runat="server">
<div>
<h1>HttpPost</h1>
Data is: <%=Request.Form["txtData"] %>
<p>
<asp:TextBox ID="txtGetValue" runat="server"></asp:TextBox>
</p>
</div>
</form>
As we see in WebForm2.aspx the line below Heading 1 Tag working fine, but I need the value of the previous page (WebForm1.aspx) in TextBox named (txtGetValue) available in second page (Webform2.aspx).