Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

ASP.NET/C#: Exit from CustomHttpModule

Using ASP.NET/C# I have a custom CustomHttpModule, referenced in web.config like this:
<add name="CustomHttpModule" type="org.HeaderHack.CustomHeaderModule" />

Open in new window

If certain criteria are met, I want to send a 404 header and exit.

I send the 404 header like this:
HttpContext.Current.Response.StatusCode = 404;

Open in new window

The problem is that the application continues after the 404 header is sent.

How can I exit the application from the CustomHttpModule?
ASKER CERTIFIED SOLUTION
Avatar of Pavel_Kudishin
Pavel_Kudishin
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial