PersonalizationScope Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Indicates the personalization scope for a WebPartManager object or the personalization scope that applies to a property on a Web Parts control.
public enum class PersonalizationScope
public enum PersonalizationScope
type PersonalizationScope =
Public Enum PersonalizationScope
- Inheritance
Fields
Name | Value | Description |
---|---|---|
User | 0 | When referring to the scope on the WebPartManager control, |
Shared | 1 | When referring to the scope on the WebPartManager control, |
Examples
The following example demonstrates using the PersonalizationScope
enumeration:
if (_manager.Personalization.Scope == PersonalizationScope.Shared)
{
TextBox2.Text = "Shared Scope";
}
else
TextBox2.Text = "User Scope";
Remarks
Personalization scope is a key concept in Web Parts personalization and is tightly integrated with other settings, including the scope that the page, through the WebPartManager control, is running in; the scope associated with each property on a control; and the way in which the control was added to the page. For more information on personalization scope, see Web Parts Personalization Overview.
Personalization scope refers to how personalization data is applicable to different sets of users. Some personalization data is applicable to only a specific user and control on a page. Other personalization data is applicable to all users who view a site. Personalization scope is used in various areas of personalization to indicate which set of data should be retrieved and displayed.
When a page is running in Shared
personalization scope, this indicates that only the personalization data for a specific control, applicable to all users viewing the control, should be loaded. Depending on the currently executing user's rights, this broadly applicable data can also be modified and saved back to the data store. When a page is running in User
personalization scope, this indicates that a control's personalization data should be saved and loaded based on the currently executing user. Usually, this means user-specific data can be loaded and saved on a control, while broadly applicable data (or shared data) can only be viewed on the control.
A WebPartManager control, which manages the high-level life cycle of personalization, executes in one of the two personalization scopes.