Wednesday, March 16, 2011

Customizing the Access Denied Message (AccessDenied.aspx)

Request from client to customize the default access denied error message!!
By Default:

After Customizing the accessdenied.aspx page:
Note: If you want to be more fancy, you can replace the simple.master page with your own master page!














Parts been customizable as show:















Achieved by modifying 2 files


1. SharePoint resource file wss.en-US.resx (from Virtual Directory \App_GlobalResources\wss.en-US.resx)







2. AccessDenied.aspx (from C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS)


Note: Please keep the Original file as a backup
















CSS:
<style type="text/css" >

BODY #s4-simple-card H1 {margin-bottom:10px; color:#5b4b3e ; font-size:2em; font-weight:normal;padding-top:3px}

.ms-sectionheader {font-family: Verdana, Arial, sans-serif; color:#595959; font-size:2em }

.ms-descriptiontext {text-align:left; font-family:Verdana, Arial, sans-serif; color:#3f3f3f;font-size:10pt}
A:link, .ms-descriptiontext A:visited, .ms-descriptiontext A:hover { color:#0072BC; font-weight:bold; text-decoration:none; }
.s4-simple-iconcont { z-index:2; background-image: url('/_layouts/images/setcredentials_32x32.png'); HEIGHT: 60px; TOP: 10px;
background-position:left center; background-repeat: no-repeat; }
.s4-simple-iconcont img {display:none;}

</style >

No comments: