SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here's what I need...User does not have access to a site (http://myserver/sites/MySite). When user tries to access they are redirected to ugly AccessDenied.aspx.

I was researching and found that using VS I can create a custom application page that user can be redirected to. I created the app page, a feature and added an event receiver to it. No matter what I do I can't get the code execute.

If user has no permissions to site does the feature ever get activated? If not, what other choices do I have to redirect to custom access denied page?

Thanks, Ninel

share|improve this question

I dont think you will need Event Receiver for your purpose, please find this thread of stackexchange SP 2010 Custom Access Denied Pages

For help with command you may find this MSDN Article helpful

For details steps please go through this Customize the Access Denied Page

share|improve this answer
Is there any way to have different custom Access Denied pages for each site? The reason I ask is becuase I would like to display contact information on each of these custom pages and the contact info is different for each site. – ninel Aug 17 '12 at 16:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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