2015-04-24 38 views
0

我有一個具有特殊權限的Sharepoint 2013文檔庫。
對於在頁面上不向用戶授予你看到一個錯誤:Web部件錯誤:訪問被拒絕。您無權執行此操作或訪問此資源。相關ID

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

但我不希望用戶看到此消息。
取而代之,我想查看庫名稱,以及何時點擊要鏈接到的庫名稱以訪問標準拒絕頁面。

我該如何解決這個問題?

回答

0

將您的代碼放入Try和Catch標籤中。

 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" 
     } 
相關問題