Episerver version: 11.10
I have created a customised FormContainerBlock that uses a controller with TemplateDescriptor.
(Based from https://www.luminary.com/blog/customising-episerver-forms )
Block:
[ContentType(DisplayName = "Form Container Block", GroupName = "Site 2")]
public class Site2FormContainerBlock : FormContainerBlock { }
Controller - the view bag values are getting set from the FormContainerBlockController
[TemplateDescriptor (AvailableWithoutTag = true, Default = true, ModelType = typeof(Site2FormContainerBlock), TemplateTypeCategory = TemplateTypeCategories.MvcPartialController)]
public class Site2FormContainerBlockController: FormContainerBlockController
{
public override ActionResult Index(FormContainerBlock currentBlock)
{
//Call base index for the Client Resource registration but not the view
//Not needed in case you manually render them in base controller
base.Index(currentBlock);
return PartialView("Site2FormContainerBlock", currentBlock);
}
}
ALL is working well on my local machine.
However, when it had been deployed to the integration server (DXC), the site went straight to the Site2FormContainerBlock.cshtml (ignoring the controller). Thus, displaying an error message due to the ViewBag fields not being set.
Is there any server-side setting that could possibly override the TemplateDescriptor?
Also, when I've checked the Content Type Definition Settings in CMS > Admin > Content Types > Blocks > [Site 2 Form Container Block] > Settings, the controller "Site2FormContainerBlockController" has been listed TWICE under the MVC Dropdown.