ERROR_INTERNET_CONNECTION_ABORTED when handling BeginRequest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top