0
votes

I have a Sharepoint 2013 document library with special permissions.
For not granted users on the page you see an error:

Error[1] Web Part Error: Access denied. You do not have permission to perform this action or access this resource. Correlation ID ...

But I do not want the user to see this message.
Instead of this, I want to see the library name and when they click on the library name I want to link to access the standard deny page .

How can I solve this problem?

1

1 Answers

-1
votes

Put Your Code Inside Try and Catch Tags.

       try
        {

        }
        catch (SPException ex)
        {
            //When You Chatch this Exception 
            //You will Draw Dynamic Hyperlink with library name and it's
           //URL="http://ServerName/_layouts/15/AccessDenied.aspx"  
        }