title: Forward and pass data along in Asp.net
body: <p>In Asp.net Entity Framework I need to forward to another page and pass some data processed by the second page along.</p>
  
  <p>In PHP I could do something like</p>
  
  <pre><code>&lt;!-- page1.php --&gt;
  &lt;form action="page2.php" method="POST"&gt;
      &lt;input type="hidden" name="id" /&gt;
      &lt;input type="submit" value="Go to page 2" /&gt;
  &lt;/form&gt;
  
  
  &lt;!-- page2.php --&gt;
  &lt;?php
      echo $_POST['id'];
  ?&gt;
  </code></pre>
  
  <p>How can this be implemented in Asp.net?</p>
  
  <p><strong>Edit</strong>: There is a simple solution using Javascript and jQuery.</p>
  
  <pre><code>&lt;!-- on page 1 --&gt;
  $('input[type=submit]').on('click', function (e) {
      // Forward to browsing page and pass id in URL
      e.preventDefault();
      var id= $('input[name=id]').val();
      if ("" == id)
          return;
  
      window.location.href = "@Request.Url.OriginalString/page2?id=" + id;
  });
  
  &lt;!-- on page 2 --&gt;
  alert("@Request.QueryString["id"]");
  </code></pre>