title: ASP .Net, Redirect to an external page while POSTING data
body: <p>Hi I have a requirement to deal with an external API in MY ASP.Net Application.</p>
  
  <p>There in a button click in my application, I have to redirect the user to an external URL at the same time POSTING some user credentials(username, password) to allow access to there (The external 3rd party page). </p>
  
  <p>If I try to access to that external page without posting credentials(Just a redirect) I will not be able to view the required page and istead an error message saying invalid credentials(From the 3rd party page).</p>
  
  <p>Suppose following are the information</p>
  
  <pre><code>1. URL need to access : https://externalurl.com/external-page.asp
  2. username           : myusername
  3. password           : mypassword
  </code></pre>
  
  <ul>
  <li>If I do a simple HTML form submission it works brilliantly as follows.</li>
  </ul>
  
  <p><img src="https://i.stack.imgur.com/cxa8n.png" alt="enter image description here"></p>
  
  <p>No Idea of how to do this in C# code in ASP .Net.</p>
  
  <p>I can post the data using <code>WebRequest</code> APIs but no way to redirect in the same session. If someone can guide on doing this would be great. Thanks in advance...!!!</p>
  
  <p><strong>Edits...</strong></p>
  
  <ol>
  <li><p>In my case I can't use javascript or any client side scripting to do this.</p></li>
  <li><p>Basically I don't have to read any response for my POST data. I need to redirect to that page(External location while posting information)</p></li>
  </ol>