I have a simple asp .net web form. I want to let the web form return nothing and close connection immediately when the particular value at Query String is not right. How do I do that?
I mean stop processing the request without returning anything at all and close the connection. Any idea?
Although Response.End() has been mentioned, it raises exceptions (ThreadAbortException). If you’re expecting to do this often, then the performance of your site might decrease because of this. Instead, you could use HttpApplication.CompleteRequest which ends the request, but not throw an exception.