Friday, March 1, 2013

Sharepoint 2010 Event Handler Redirection to Custom Error page


Sharepoint 2010 comes with bundle of new features to support different business scenarios. In sharepoint 2007 most of the developer had a hard time in handling the following scenario.

Scenario
In a custom event receiver redirect user to a custom error page after the validation failure.

In sharepoint 2007 there was no support for this scenario so usually every one set the error message and gets redirected to default out of the box error page. This default page will not match the theme of the site as well as the user experience.

Sharepoint 2010 comes with new properties for handling the scenario

properties.Status = SPEventRecieverStatus.CancelWithRedirectUrl;
Properties.
RedirectUrl = “/_layouts/MyBlog/CustomError.aspx" 

No comments:

Post a Comment