Redirecting Application-Level Error Handler
<pre><code>protected void Application_BeginRequest(object sender, EventArgs e)
    {


        const int maxFileSizeKBytes = 10240; //10 MB
        const int maxRequestSizeKBytes = 305200; //~298 MB

        if (Request.ContentLength &gt; (maxRequestSizeKBytes * 1024))
        {
            Response.Redirect(".aspx?requestSize=" + Request.ContentLength.ToString());
        }


        for (int i = 0; i &lt; Request.Files.Count; i++)
        {
            if (Request.Files[i].ContentLength &gt; (maxFileSizeKBytes * 1024))
            {
                Response.Redirect(".aspx?fileSize=" + Request.Files[i].ContentLength.ToString());
            }
        }

    }
</code></pre>

<p>This code is in Global.asax.cs page.
I need to redirect to the page that triggered this check. And I need to know the ticketId or projectId parameter. For example I create new ticket at the View Project page <code>/Project/ViewProject.aspx?projectId=1</code> I need to redirect to this page with a meaningful message to the user, because I think that redirecting to another page to display the error message is not a good idea.</p>
