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)
public: [BrowsableAttribute(false)] property bool HasPersonalizationState { virtual 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 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.
Available since 2.0