When working with MVC forms in Sitefinity CMS, you can take advantage of helper elements. You can drop elements on your form just like the standard form fields, but unlike fields, elements are not meant to collect user input. By default, there are a few build-in elements in the standard toolset, for example, Recaptcha and Section header.
The following tutorial demonstrates how to create a new MVC form element for displaying text content that is read-only. You first create the folder structure, then the custom model, controller, and view and finally register the element in Sitefinity CMS toolbox.
NOTE: This example uses plain C# classes for the model.
To create the custom model, perform the following:
NOTE: When creating new form elements, your controller can inherit FormElementControllerBase. Thus, you do not have to implement specific methods needed to display the element in the form. The FormElementControllerBase provides two actions - Write and Read, which are invoked depending on the Form widget settings. If your custom element does not have one of these modes, you can override the particular action and redirect to the other.
Back To Top
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important
Copyright © 2021 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.
Progress, Telerik, Ipswitch, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.
Powered by Progress Sitefinity