I want to handle PageModel using custom Controller/Action in DXA module.
I added controller:
public class CustomPageController : PageController
{
public override ActionResult Page(string pageUrl)
{
return base.Page(pageUrl);
}
}
and registered page model view:
RegisterViewModel("AssetPage", typeof(PageModel), "CustomPage");
but when I'm triyng to reach the page I get the error: No View Model registered for View 'MyWeb:Page:AssetPage'. Check that you have registered this View in the 'MyWeb' area registration.
EnrichModel
instead ofPage
.