title: Getting values posted by a form on target page ASP.NET
body: <p>I am new to asp.net and learning it to my own. I just want to submit a form on another asp.net page and want to retrieve all the posted values on that page! I have tried the following code (I am just testing and learning asp.net to my own so this code may have some blunders).</p>
  
  <p>My Default.aspx page (submitting the form with values):</p>
  
  <pre><code> &lt;body&gt;
     &lt;form id="form1" runat="server" action="formtarget.aspx" method="post" onsubmit="return Validate()"&gt;
      &lt;div&gt;
          &lt;asp:Label ID="namelab" Text="Your Name" runat="server"&gt;&lt;/asp:Label&gt;
          &lt;asp:TextBox ID="namebox" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;asp:Label ID="agelab" Text="Your Age" runat="server"&gt;&lt;/asp:Label&gt;
          &lt;asp:TextBox ID="agebox" runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;/div&gt;
      &lt;div&gt;
          &lt;asp:Button ID="submitbutton" Text="Submit" runat="server"/&gt;
      &lt;/div&gt;
     &lt;/form&gt;
   &lt;/body&gt; 
  </code></pre>
  
  <p>The formtarget.aspx</p>
  
  <pre><code>  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
       &lt;div&gt;
         You Entered The Following Details!&lt;br /&gt;
         Your Name: &lt;asp:Label ID="namelab" runat="server"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
         Your Age: &lt;asp:Label ID="agelab" runat="server"&gt;&lt;/asp:Label&gt;
       &lt;/div&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  </code></pre>
  
  <p>The formtarget.aspx.cs (here i want to access the posted values by Default.aspx page form)</p>
  
  <pre><code> public partial class formtarget : System.Web.UI.Page
   {
     protected void Page_Load(object sender, EventArgs e)
     {
      String name = Request.QueryString["namebox"];
      String age = Request.QueryString["agebox"];
  
      namelab.Text = name;
      agelab.Text = age;
    }
   }
  </code></pre>
  
  <p>The code is working fine for me but the page formtarget.aspx is not showing up any values.</p>
  
  <p>I know that I can use the Default.aspx.cs to get my form values but I am just learning how can I post my form to another page.</p>
  
  <p>Thanks</p>