SaaS CMS has officially launched! Learn more now.

Episerver Forms - Creating a wrapper FormContainerBlock


I've built a FormContainerWithNavigationBlock that is meant to wrap the original FormContainerBlock.  I've got it wired up and it's mostly working, however when I call the original FormContainerBlock.ascx, it's returning an "Object reference not set to an instance of an object" exception.  Is this the correct path to the original FormContainerBlock view?

@using EPiServer.Core
@using EPiServer.Forms.Implementation.Elements

@model Reyes.Episerver.Model.Models.Block.FormContainerWithNavigationBlock

    if (Model != null && Model.ElementsArea.Items.Any())
        var formStepItems = Model.ElementsArea.Items.Where(x => x.GetContent() is FormStepBlock);


@Html.Partial("/Episerver/EPiServer.Forms/Views/ElementBlocks/FormContainerBlock.ascx", Model)
Sep 28, 2017 21:16

Moving my view to ~/views/Shared/ElementBlocks/ as specificed in ~/modules/_protected/EPiserver.Forms/forms.config resolved my issue.

Sep 29, 2017 0:34

Hey, I answered here, but essentially, if you just want to change rendering of FormsContainerBlock, it's way easier to just override the view by copying it to Views/Shared/ElementBlocks.

Sep 29, 2017 11:19
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.