Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
HandleAccessDenied method
Collapse the table of content
Expand the table of content

SPUtility.HandleAccessDenied method

Handles access denied exceptions.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public static void HandleAccessDenied(
	Exception ex


Type: System.Exception

The exception that occurred.

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.

© 2015 Microsoft