title: User redirect with POST in iframe
body: <p>I am building one of my first MVC 4 applications and I need some help with redirecting users.</p>
  
  <p>I have a windows form application where I use a <code>AxSHDocVw.AxWebBrowser</code> to redirect the user to a specific URL , a SOAP web service to be precise, aswell as sending HTTP POST and HEADER data aswell. 
  This is done like so:</p>
  
  <pre><code>oHeaders = "Content-Type: application/x-www-form-urlencoded" + "\n" + "\r";
  sPostData = "ExchangeSessionID=" + SessionID;
  oPostData = ASCIIEncoding.ASCII.GetBytes(sPostData);
  
  axWebBrowser2.Navigate2(ref oURL, ref o, ref o, ref oPostData, ref oHeaders);
  </code></pre>
  
  <p>I am looking to replicate this functionality in my MVC application, but am unsure of the how this can be done.</p>
  
  <p>I was hoping to have this within an iframe, but can't find a way of sending the POST and HEADER data from this. This is what I have been trying so far:</p>
  
  <p><strong>Controller</strong></p>
  
  <pre><code> ViewBag.URL = TempData["URL"];
   ViewBag.SessionID = TempData["SessionID"];
   ViewBag.FullURL = TempData["URL"] + "?ExchangeSessionID=" + TempData["SessionID"];
   return View();
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>&lt;iframe src="@ViewBag.FullURL" width="100%" height="500px"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>Basically I was trying to append the data to the end of the URL hoping this would work for the HTTP POST part. This is what I ended up with:</p>
  
  <pre><code>https://www.myurl.aspx?ExchangeSessionID=87689797
  </code></pre>
  
  <p>The user is being directed to the page, but the web service is giving me an error ( which tells me it is now receiving the POST data).</p>
  
  <p>Can some please help me to try and fix this, or even give me advice on how to go about this another way. Like I said, I'm fairly new to MVC applications and I'm not entirely sure what I'm tryin to do is even possible.</p>
  
  <p>Any help is appreciated. Thanks</p>