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)

Syntax

'Declaration
Protected Overridable Sub RenderValidationMessage ( _
    output As HtmlTextWriter _
)
'Usage
Dim output As HtmlTextWriter

Me.RenderValidationMessage(output)
protected virtual void RenderValidationMessage(
    HtmlTextWriter output
)

Parameters

Remarks

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

Reference

BaseFieldControl class

BaseFieldControl members

Microsoft.SharePoint.WebControls namespace

IsValid

Validate

ErrorMessage

Other resources

Patterns of Custom Field Rendering

Custom Field Types

Walkthrough: Creating a Custom Field Type