Redirect to IIS 401/403 error page in HttpModule?

G

Guest

Is it possible to redirect to an IIS 401 or 403 error page by setting the
Response.StatusCode in an HttpModule?

Right now, my code look like:
e.Context.Response.StatusCode = 401;
e.Context.Response.End();

This passes back the proper headers, but fails to produce an error page on
the client side. Is it to late for IIS to respond with an error page, or do
we have to hook it up ourselves?
 
B

Ben Strackany

Yes, it's too late at that point. You could fake it by redirecting the user
to a page that doesn't exist.
 

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,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top