Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Handles access denied exceptions.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
<SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)> _
Public Shared Sub HandleAccessDenied ( _
ex As Exception _
)
'Usage
Dim ex As ExceptionSPUtility.HandleAccessDenied(ex)
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.PerSpec)]
public static void HandleAccessDenied(
Exception ex
)
Parameters
ex
Type: System.ExceptionThe exception that occurred.
Remarks
Use the HandleAccessDenied method to handle access denied exceptions in the same way as Windows SharePoint. Depending on the authentication mode, whether client is a browser, or whether the request is a SOAP request, the HandleAccessDenied method may return a 401 exception to ask user to authenticate, or a 403 exception in forms authentication mode for non-browser client, or redirect to the accessDenied.aspx page if the user is already authenticated.