title: redirect to error on exceeding fileupload size
body: <p>I am trying to direct user to a error page when maximum fileupload size excedds.For this iam doing the following thing:</p>
  
  <pre><code>public void Init(HttpApplication application)
      {
          application.BeginRequest += new EventHandler(application_BeginRequest);
      }
  
      void application_BeginRequest(object sender, EventArgs e)
      {
          HttpApplication application = (HttpApplication)sender;
          HttpContext context = application.Context;
          if (context.Request.ContentLength &gt; 4096000)
          {
              context.Response.Redirect("~/Error.aspx");
          }
      }
      public void Dispose()
      {
      }
  </code></pre>
  
  <p>But on uploading file with size more than the max filesize it is showing "connection reset" error.
  How should i do this.</p>