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)


Protected Friend ReadOnly Property ShouldValidate As Boolean
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.


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


WebPart class

WebPart members

Microsoft.SharePoint.WebPartPages namespace