To use data annotations with RTE, kindly ensure the following steps:
Step 1: Add necessary scripts and theme files for RTE and validation to work properly in the _Layout.cshtml.
Step 3: Add a model class and make sure to include “AllowHtml” attribute for the RTE’s field to allow HTML content to be posted to the controller.
Step 4: Add a form with the RTEFor control. Include the label and validation message placeholders for RTE control.
Step 5: Add script to modify the validator settings and include the hidden fields in validation. Since RTE uses hidden <textarea> element to store its content.
Step 6: Add an Action method in the controller to handle the form post. You can retrieve the RTE’s content from the model.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|