Pages

Search This Blog

Monday, January 9, 2012

Sharepoint Access Denied Page

Sometimes in your web part pages you may want to show the same "Access Denied" screen to the user that SharePoint provides by default when user has no access to any resource or page.


This can be easily achieved by making use of SPUtility Class of sharepoint as:


            try
            {
               //your custom code
               SPUtility.HandleAccessDenied(new Exception("not authorized"));
            }
            catch (Exception Ex)
            {
            }



No comments:

Post a Comment