title: WebRequest follow redirect
body: <p>I have a page (url a) which submits a form programmatically using a WebRequest.<br>
  The page that accepts the form request does a bunch of stuff and then redirects to another page (url b)  </p>
  
  <p>Is it possible at all to perform the webrequest (which reads, processes and redirects the form request), which then makes the current page (url a) redirect to the webrequest end location (url b).  </p>
  
  <p>I currently have;</p>
  
  <pre><code>  HttpWebRequest myRequest = (HttpWebRequest)HttpWebRequest.Create(url + postVars);  
    myRequest.AllowAutoRedirect = true;
  
    HttpWebResponse myResponse = (HttpWebResponse)myRequest.GetResponse();  
    myRequest.AllowAutoRedirect = true;
  
    // Read response stream
    StreamReader myStream = new StreamReader(myResponse.GetResponseStream());  
    string response = myStream.ReadToEnd();  
    myResponse.Close();
  </code></pre>
  
  <p>This all works fine and everything happens as expected apart from after the <code>myResponse.Close()</code>, I am still at url a, not url b, i.e the page that the request was made from is still the active page</p>
  
  <p>Any ideas on where I am going wrong? Or any better ideas?</p>
  
  <p>I need to be able to.   </p>
  
  <ul>
  <li>Open page a  </li>
  <li>submit a form programmatically to module b (another page)  </li>
  <li>Be redirected to page c (of which is based on the redirect from module b)</li>
  </ul>
  
  <p>Does that make sense?<br>
  Thanks in advance.</p>