Partilhar via


WebPart.ShouldValidate Property

Gets a value indicating whether the Web Part infrastructure should perform data validation of Web Part properties before setting them.

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

Syntax

'Declaration
Protected Friend ReadOnly Property ShouldValidate As Boolean
    Get
'Usage
Dim value As Boolean

value = Me.ShouldValidate
protected internal bool ShouldValidate { get; }

Property Value

Type: System.Boolean
true if the Web Part properties need to be validated; otherwise, false.

Remarks

The value of the ShouldValidate property is always true unless the Web Part's properties are being deserialized with the data retrieved from the SharePoint Foundation database. In this case, the properties do not need to be validated because they were previously validated before storage, and the ShouldValidate property value will be false. This property is available only at runtime.

See Also

Reference

WebPart Class

WebPart Members

Microsoft.SharePoint.WebPartPages Namespace