Share via


WebPartStorageAttribute class

Specifies how a property should be stored.

Inheritance hierarchy

System.Object
  System.Attribute
    Microsoft.SharePoint.WebPartPages.WebPartStorageAttribute

Namespace:  Microsoft.SharePoint.WebPartPages
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple := False)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
Public NotInheritable Class WebPartStorageAttribute _
    Inherits Attribute
'Usage
Dim instance As WebPartStorageAttribute
[AttributeUsageAttribute(AttributeTargets.Property, AllowMultiple = false)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
public sealed class WebPartStorageAttribute : Attribute

Remarks

If a WebPartStorageAttribute attribute is not specified for a property, Personal is used by default. If a WebPartStorageAttribute attribute is specified for a property but the ControlledExport property is not set, the value is presumed to be set to false.

If you are developing SharePoint 2003 Web parts, you can apply both the PersonalizableAttribute attribute and the WebPartStorageAttribute attribute to change the serialization method. However, for later versions of SharePoint, the PersonalizableAttribute attribute is the default option used to deserialize the web part before using the WebPartStorageAttribute attribute.

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See also

Reference

WebPartStorageAttribute members

Microsoft.SharePoint.WebPartPages namespace