November Happy Hour will be moved to Thursday December 5th.

Custom rendering of Episerver Forms only works in edit mode

Vote:
 

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?

#178619
May 15, 2017 17:03
Vote:
 

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 :)

#178634
May 16, 2017 10:47
Vote:
 

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

I'm a happy developer again, thanks!

#178635
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.