I have a custom Form Controller in a DXA 1.2 web application that is working fine at request time but when I post the form data back to that Controller and return the Entity DXA throws an error as it has lost the MvcData for my custom controller.
ERROR - Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'.
System.Web.HttpException (0x80004005): Error executing child request for handler 'System.Web.Mvc.HttpHandlerUtil+ServerExecuteHttpHandlerAsyncWrapper'. ---> System.InvalidOperationException: The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Form/Index.aspx
~/Views/Form/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Form/Index.cshtml
~/Views/Form/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
at System.Web.Mvc.ViewResult.FindView(ControllerContext context)
Controller code:
public class FormController : EntityController
{
[HandleSectionError(View = "SectionError")]
public ActionResult Index(EntityModel entity, int containerSize = 0)
{
// The List action is effectively just an alias for the general Entity action (we keep it for backward compatibility).
return Entity(entity, containerSize);
}
[HttpPost]
public ActionResult Index(Form form)
{
//do stuff here and modify the success flag
form.SubmittedSuccessfully = true;
return Entity(form);
}
}
Is there anyway to re-populate this data?