G
Guest
Hello
I'm using .NET Framework v2.
I'm trying to cancel the request writing a BeginRequest handler in
Global.asax.
Here is sample code:
// Just some condition to check - in this sample checking for request size
int maxRequestLengthBytes = 2000;
if (Request.ContentLength > maxRequestLengthBytes)
{
Response.Clear();
Response.StatusCode = 200;
Response.Write(@"<html><head></head><body></body></html>");
Response.Flush();
if (Context.ApplicationInstance != null)
Context.ApplicationInstance.CompleteRequest();
return;
}
Instead of return code 200 IE gets ERROR_INTERNET_CONNECTION_ABORTED and
retries the request. What am i doing wrong? Any help is appreciated.
Thanks in advance.
I'm using .NET Framework v2.
I'm trying to cancel the request writing a BeginRequest handler in
Global.asax.
Here is sample code:
// Just some condition to check - in this sample checking for request size
int maxRequestLengthBytes = 2000;
if (Request.ContentLength > maxRequestLengthBytes)
{
Response.Clear();
Response.StatusCode = 200;
Response.Write(@"<html><head></head><body></body></html>");
Response.Flush();
if (Context.ApplicationInstance != null)
Context.ApplicationInstance.CompleteRequest();
return;
}
Instead of return code 200 IE gets ERROR_INTERNET_CONNECTION_ABORTED and
retries the request. What am i doing wrong? Any help is appreciated.
Thanks in advance.