Share via


RichHtmlField.Validate Method

Validates the content posted to this control.

Namespace:  Microsoft.SharePoint.Publishing.WebControls
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
<SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel := True)> _
Public Overrides Sub Validate
'Usage
Dim instance As RichHtmlField

instance.Validate()
[SharePointPermissionAttribute(SecurityAction.Demand, ObjectModel = true)]
public override void Validate()

Implements

IValidator.Validate()

Remarks

This method uses an HtmlValidationContext.ValidateHtml method to ensure that the content is safe and to validate that the content meets any constraints specified by the various constraint properties of this control that start with the word "Allow." It also ensures that there is a value if the Field.Required schema property is set to true.

If any "Allow" constraints, violations, or "Required" violations occur, then it sets IsValid to false and its ErrorMessage property to a description of the validation problem.

See Also

Reference

RichHtmlField Class

RichHtmlField Members

Microsoft.SharePoint.Publishing.WebControls Namespace

RichHtmlField