Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Redirect to URL in SharePoint Foundation 2010

SharePoint 2010

Last modified: April 08, 2010

Applies to: SharePoint Foundation 2010

Microsoft SharePoint Foundation 2010 now allows event receivers to provide a redirection URL to provide custom messages through the user interface (UI).

Microsoft SharePoint Foundation 2010 now supports an event receiver that provides a redirect URL to an error message. This capability allows you to customize your error messages and provide specific guidance for users, allowing for different user experiences, depending on the error. However, these redirect URLs do not work in all cases. For example, when users save files from a Microsoft Office application, the redirect URL is ignored.

The redirect URL feature works with all pre-event receiver types (such as SPWebEventReceiver, SPListEventReceiver, and SPItemEventReceiver) in cases where the action is being cancelled. To support the new user interfaces, SharePoint Foundation 2010 added the CancelWithRedirectUrl field to values in the SPEventReceiverStatus enumeration.


SPEventReceiverStatus
{
    CancelNoError,
    CancelWithError,
    CancelWithRedirectUrl,
    Continue
}

CancelWithRedirectUrl allows you to specify a redirect URL for a Web browser UI. Use the URL that is specified by the RedirectUrl property of the SPEventPropertiesBase object to navigate to alternate pages. This URL should be a server-relative URL, and cannot contain ECMAScript (JavaScript, JScript).

Show:
© 2015 Microsoft