Redirect from the OnException-method inside the controller with ASP.Net MVC

If your controller uses the HandleError-Attribute it handles exceptions thrown by action methods. I wanted to catch these exceptions and redirect to a custom error page. A simple RedirectToAction inside the OnException method does not work. But the ExceptionContext is all we need. #region Error handling protected override void OnException(ExceptionContext filterContext) { // Make use […]

Redirecting from NewForm.aspx to DispForm.aspx after creating a new item

The requirement Recently a simple requirement came up: “Redirect the user to the view-form of an item after he creates a new item”. Sounds simple, right? … The default behavior of SharePoint is to redirect the user to the url defined by the Source-parameter. If this parameter is not given the default view (mostly AllItems.aspx) […]