SPFieldFile.ValidateAndParseValue method
Validates and parses the input value and returns a valid object that can be the value of the field.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Overrides Function ValidateAndParseValue ( _
item As SPListItem, _
value As String _
) As Object
'Usage
Dim instance As SPFieldFile
Dim item As SPListItem
Dim value As String
Dim returnValue As Object
returnValue = instance.ValidateAndParseValue(item, _
value)
public override Object ValidateAndParseValue(
SPListItem item,
string value
)
Parameters
item
Type: Microsoft.SharePoint.SPListItemAn SPListItem containing a field whose new value needs to be validated.
value
Type: System.StringA string with the value to be parsed and returned.
Return value
Type: System.Object
An object that can be assigned to the field as its value.
Exceptions
Exception | Condition |
---|---|
SPFieldValidationException | The filename ends with ".aspx" or is not valid for some other reason. -- or -- Value is a null reference (Nothing in Visual Basic) or an empty string. |
ArgumentNullException | Item is a null reference (Nothing in Visual Basic). |
Remarks
This override validates that value does not violate any rules for SharePoint filenames and returns it or throws an exception if it is not valid.