BaseFieldControl.RenderValidationMessage Method

Renders an error message about the invalidity of the value in the Value property.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No


Protected Overridable Sub RenderValidationMessage ( _
    output As HtmlTextWriter _
Dim output As HtmlTextWriter

protected virtual void RenderValidationMessage(
    HtmlTextWriter output



With the default implementation, RenderValidationMessage does nothing if IsValid is true.

If IsValid is false, an error message is rendered. This is the value of ErrorMessage, unless it is a null reference (Nothing in Visual Basic) in which case a generic error message is rendered.

Notes to Inheritors

Value is the value of the control in the UI, not the underlying value (which is ItemFieldValue) of the SPField object that has the BaseFieldControl as its FieldRenderingControl property. Use RenderValidationMessage only when you need validation of the UI value. To validate ItemFieldValue, use GetValidatedString().

See Also


BaseFieldControl Class

BaseFieldControl Members

Microsoft.SharePoint.WebControls Namespace




Other Resources

How to: Create a Custom Field Type

Custom Field Types

Walkthrough: Creating a Custom Field Type