FormBlock
The FormBlock server control displays a content block associated with a form. When added to a template and visited, the form content block might look like the following example. You can change the display to suit your needs by modifying its properties. See also: Working with HTML Forms.
IMPORTANT: If you create a template for an existing form content block, you must manually change its quicklink to point to the new template. This change does not occur automatically. This procedure is described in Adding a Quicklink to Content.
Inserting the FormBlock server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the FormBlock server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:FormBlock ID="FormBlock1" runat="server" />
- Click on
FormBlock
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
FormBlock properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- AddValidation (Boolean)
The AddValidation property is obsolete and ignored. It has no effect. It is always true.
- CacheInterval (Double)
The number of seconds that a server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified.’s data is cached. The default is 0 (zero). For example, if you want to cache the data for 5 minutes, set to 300. See also: Caching with server controls.
- DefaultFormID (Long)
The ID of a FormBlock that appears where you inserted this server control if no other form block is identified. If you don’t know the ID number of the form block, use the CMS Explorer to browse to it.See also: Browsing your Ektron site using CMS Explorer.
- DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- DynamicParameter (String)
To make this form block dynamic, select id. When you do, this server control uses the form block passed as a URL parameter.
- Fields (FormFieldCollection)
Displays a list of fields that are defined in the form. These fields are read only. This is an excellent way of displaying the field names used on the form. With this list of names, you can create events using the fields without having to enter the Workarea to see the names.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- IncludeTags (Boolean)
Determines if tags are generated automatically of manually.
- Language (Integer)
Set a language for viewing content; shows results in design-time (in Visual Studio) and at run-time (in a browser).
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- WrapTag (String)
Lets a developer specify a server control’s tag.
- Span (default). Designate an inline portion of an HTML document as a span element.
- Div. Apply attributes to a block of code.
- Custom. Lets you use a custom tag.