Compartilhar via


SPField.GetValidatedString Method

Validates and converts the field value into a serialized form.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Overridable Function GetValidatedString ( _
    value As Object _
) As String
'Usage
Dim instance As SPField
Dim value As Object
Dim returnValue As String

returnValue = instance.GetValidatedString(value)
public virtual string GetValidatedString(
    Object value
)

Parameters

Return Value

Type: System.String
The serialized form of the value.

Remarks

This method is used for data serialization logic and for field validation logic that is specific to a custom field type.

In a custom type-specific class, override this method to define the following kinds of logic:

  • Data-validation; for example, to throw an exception in server-side code if the field is required.

  • Pre-update data processing; for example, to filter out bad data but not fail validation.

  • Serialization; for example, to convert a field value object into string format.

See Also

Reference

SPField Class

SPField Members

Microsoft.SharePoint Namespace