Our monthly Virtual Happy Hour is happening this week, Fri Feb 23!

Try our conversational search powered by Generative AI!

Custom rendering of Episerver Forms only works in edit mode


I just tried to do a minor change in how forms are rendered. I copied FormContainerBlock.ascx to /Views/Shared/ElementBlocks/ and updated the markup. Everything works a expected, I'm a happy developer...

...until I looked at the page i view mode. In view mode I still see the old default view (logged or not logged in gives the same result). When switching back to edit mode the form get's rendered with my custom view. 

What am I doing wrong? 
Is the view location cached somehow? If so, how do I release the cache?

May 15, 2017 17:03

The FormContainerBlock.ascx view contains an if statement around whether the page is in edit mode, meaning that there are two sets of markup. Are you sure you're not just edited the markup relevant to the edit mode display?

I got caught out by this :)

May 16, 2017 10:47

Haha, I was just doing a quick POC, and yes, I had done exactly that.

I'm a happy developer again, thanks!

May 16, 2017 11:07
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.