title: Throw http exception (Unauthorized) from Application_Error
body: <p>I am trying to throw this row from Global asax Application_Error</p>
  
  <pre><code>throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
  </code></pre>
  
  <p>But for some reason I am getting 200 and not 401 in the browser, do you know why?</p>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>protected void Application_Error(object sender, EventArgs e)
  {        
      throw new HttpException((int)HttpStatusCode.Unauthorized, "Forbidden");
  }
  </code></pre>