title: MVC4 - Server cannot set status after HTTP headers have been sent
body: <p>After moving to MVC4 from MVC3, this line </p>
  
  <pre><code>Return Redirect("https://secure.mysite.com/account/signup")
  </code></pre>
  
  <p>started to throw exception</p>
  
  <pre><code>Server cannot set status after HTTP headers have been sent
  </code></pre>
  
  <p>This is the method in </p>
  
  <pre><code>Function signup() As ActionResult
  
      Dim HTTP_HOST = Request.ServerVariables("HTTP_HOST")
  
      If Request.IsSecureConnection = False Or HTTP_HOST &lt;&gt; "secure.mysite.com" Then
          Return Redirect("https://secure.mysite.com/account/signup")
      End If
  
  
      'more code here
  
       Return View(_viewModel)
  End Function
  </code></pre>
  
  <p>Can't figure this out because Return redirect line above is the first time session is being sent back.</p>