4

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.

1

Custom Region Controllers are currently unfortunately not supported in DXA.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.