I am trying to develop a Custom Access Denied Page. Trying to display some information on the page. User's information, The site they came from, and the document/page they tried to access.

I can get the user's information from Clientcontext and the site they came from via Httpcontext.Request.UrlReferrer but I don't know how to get the url of the document/page they clicked before hitting the access denied page. Is there a way to get this?

Many thanks,


  • Thanks for the heads up. I've posted it as an answer now. – ova Mar 2 '16 at 8:08

I have managed to get this by the Source parameter from the access denied page's url. I'm using something like this:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.