Is it possible to override the default Region controller in DXA 1.7
Looking at the RegionController
in Github it is decorated with HandleSectionError
attribute to handle exceptions.
I try to bypass that handler and handle those exception in the Page model instead.
I try to create my custom RegionController
like this:
public class RegionController : Sdl.Web.Mvc.Controllers.RegionController
{
public override ActionResult Region(RegionModel region, int containerSize = 0)
{
// Do custom stuff here
return base.Region(region, containerSize);
}
}
And register in the area registration like this:
// My own region controller should be use
RegisterViewModel("MyRegionName", typeof(RegionModel), "RegionController");
But still seems to be using the default one.