Custom Error pages

R

Rich

Hi All,

I have a windows authenticated web site - a sub directory
has been secured by denying various roles. When access is
denied the default error page for 401.2 is displayed -
How can I customise my own access denied page?
I have tried custom error tags in the web.config but that
doesnt seem to work, nor does changing the IIS error page
settings.

Any ideas?

Cheers,
Rich
 
K

Ken Schaefer

You can attempt to customise the page (and IIS will send the customised
page - you can check using network sniffer), but it is up to the browser to
decide what to display. Most (if not all) browsers will *not* display custom
content when the HTTP status from the server is 401 - they will either
display a logon dialogue box -or- they will display an "access denied" error
message (after three, or whatever, failed attempts). This is a security
measure on the part of the browser.

What you would need to do is intercept the 401.2 HTTP status, and change it
to something else (eg 200 OK), and then you can server whatever content you
want.

Cheers
Ken
 

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,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top