From 3f2782d6544e568c6809a27b33443ac80bb04431 Mon Sep 17 00:00:00 2001 From: Horsman Date: Thu, 22 Dec 2016 17:39:01 +0100 Subject: [PATCH 1/2] Improve HandleSectionErrorAttribute. https://github.com/sdl/dxa-web-application-dotnet/issues/36 --- Sdl.Web.Mvc/Controllers/HandleSectionErrorAttribute.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sdl.Web.Mvc/Controllers/HandleSectionErrorAttribute.cs b/Sdl.Web.Mvc/Controllers/HandleSectionErrorAttribute.cs index c00f11af..eeb6e699 100644 --- a/Sdl.Web.Mvc/Controllers/HandleSectionErrorAttribute.cs +++ b/Sdl.Web.Mvc/Controllers/HandleSectionErrorAttribute.cs @@ -13,7 +13,7 @@ public override void OnException(ExceptionContext filterContext) base.OnException(filterContext); Log.Error(filterContext.Exception); ViewDataDictionary data = new ViewDataDictionary(new HandleErrorInfo(filterContext.Exception, (string)filterContext.RouteData.Values["controller"], (string)filterContext.RouteData.Values["action"])); - filterContext.Result = new ViewResult { ViewName = View, ViewData = data }; + filterContext.Result = new PartialViewResult { ViewName = View, ViewData = data }; filterContext.ExceptionHandled = true; filterContext.HttpContext.Response.TrySkipIisCustomErrors = true; } From baa04a6d68e42536f198e60e7d06928f518b8a3b Mon Sep 17 00:00:00 2001 From: Horsman Date: Thu, 22 Dec 2016 17:56:20 +0100 Subject: [PATCH 2/2] Reset layout in ServerError view. https://github.com/sdl/dxa-web-application-dotnet/issues/36 --- Site/Views/Shared/ServerError.cshtml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Site/Views/Shared/ServerError.cshtml b/Site/Views/Shared/ServerError.cshtml index 1047600e..ef6d61e1 100644 --- a/Site/Views/Shared/ServerError.cshtml +++ b/Site/Views/Shared/ServerError.cshtml @@ -1,4 +1,7 @@ - +@{ + Layout = ""; +} +