Export (0) Print
Expand All

WebPartPersonalization.HasPersonalizationState Property

Returns a value indicating whether the current page and personalization scope have associated personalization data.

Namespace:  System.Web.UI.WebControls.WebParts
Assembly:  System.Web (in System.Web.dll)

[BrowsableAttribute(false)]
public virtual bool HasPersonalizationState { get; }

Property Value

Type: System.Boolean
true if the page has personalization data associated with it; otherwise, false.

ExceptionCondition
InvalidOperationException

There is no personalization provider associated with the WebPartPersonalization instance. This can occur if the property is accessed prior to the completion of the associated WebPartManager control's OnInit method.

- or -

The value of the Page property for the associated WebPartManager is null.

- or -

The value of the Request property on the WebPartManager control's associated Page instance is null.

This is a convenient method for determining whether the current page and scope combination has personalization data associated with it. Internally, the method calls GetCountOfState on the provider to determine whether data exists.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2015 Microsoft