WebPartPersonalization::HasPersonalizationState Property
Returns a value indicating whether the current page and personalization scope have associated personalization data.
Assembly: System.Web (in System.Web.dll)
[BrowsableAttribute(false)] public: virtual property bool HasPersonalizationState { bool get (); }
Property Value
Type: System::Booleantrue if the page has personalization data associated with it; otherwise, false.
| Exception | Condition |
|---|---|
| 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 nullptr. - or - The value of the Request property on the WebPartManager control's associated Page instance is nullptr. |
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 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.