This documentation is archived and is not being maintained.

WebPartPersonalization.HasPersonalizationState Property

Note: This property is new in the .NET Framework version 2.0.

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)

public virtual bool HasPersonalizationState { get; }
/** @property */
public boolean get_HasPersonalizationState ()

public function get HasPersonalizationState () : boolean

Property Value

true if the page has personalization data associated with it; otherwise, false.

Exception typeCondition


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 a null reference (Nothing in Visual Basic).

- or -

The value of the Request property on the WebPartManager control's associated Page instance is a null reference (Nothing in Visual Basic).

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.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0