Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
HasPersonalizationState Property

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)

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

public function get HasPersonalizationState () : boolean

Not applicable.

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

© 2015 Microsoft