Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Setting a Form element as a property caused an error in view mode.

Found in

EPiServer.Forms 2.1

Fixed in

EPiServer.Forms 3.0.0

(Or a related package)

Created

Jun 02, 2016

Updated

Jul 07, 2016

Area

Core

State

Closed, Fixed and tested


Description

An error occurred only in View mode if you set a form element as a property. (See procedure.) You can browse to Edit mode and remove the shared block from the *contentArea *to view the Start or Home page again.

  1. Create a block that inherits from FormContainerBlock and create a property of type *TextBoxElement *block along with a string type property.
  2. Create a view that renders the property (such as FirstName).
  3. Go to the site and create a shared block of this block type and then place it anywhere on a *contentArea * (such as on the Alloy home page).
  4. Save and publish.
  5. Close the browser and attempt to browse to site to Start or Home page. An error occurs: Object reference not set to an instance of an object.

NOTE: It is not encourage to use Form this way. FormElement should be drag and drop into the ElementsArea of FormContainerBlock (FCB). We only fix this bug to not raise exception and Form can be rendered in ViewMode (and it's not the way Form designed to work).