In my page load I check something, and I want to display the standard Access Denied message without going through the hassle of creating a page to redirect to.
Is there an easy way?
You want to return a HTTP return code of 401 ("access denied")
So,
Response.Clear();
Response.StatusCode = 401;
Response.End();
should do the trick
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With