
Key Concepts in Personalization
When you use personalization with Web Parts controls, you should understand several concepts that affect how personalization works.
The first concept is page personalization scope. Page personalization scope is the range of users to which personalization changes on a page can apply. At any given time, a Web Parts page can be in one of two possible page personalization scopes, Shared or User. In Shared scope, any personalization changes on the page apply to all users; in User scope, personalization changes on the page apply only to the current user.
A second and related concept is control visibility. Control visibility determines whether a given control is visible to an individual user or to all users. Each WebPart control on a page is either a shared control, visible to all users of that page, or a per-user control, visible only to an individual user. Visibility is determined by how a control is added to a page. If a control is added by declaring it in the markup of a Web page (a static control), it is always a shared control. If a control is added by application code or by a user selecting it from a catalog of controls (a dynamic control), visibility is determined by the current personalization scope of the page. If the page is in Shared scope, a dynamically added control is shared, and if the page is in User scope, the control is a per-user control.
A third important concept is property scope. When you create a personalizable property on a control using the Personalizable attribute in the source code, you can set the personalization scope for the property to either Shared or User (User is the default scope). This provides detailed control over which properties on a control can be personalized by all users, and which can be personalized only by authorized users when the page scope is Shared.
Taken together, these concepts of page personalization scope, control visibility, and property personalization scope create the range of options for how Web Parts controls can be viewed and personalized by users. The following table summarizes how Web Parts controls behave when users personalize them in the various scopes.
Control visibility
|
Page in Shared scope
|
Page in User scope
|
|---|
shared control (WebPart controls are shared by default)
|
An authorized user can personalize both Shared and User scoped properties on the control for all users.
In the case of a dynamic control (a control that is added to the page programmatically, or from a catalog of controls), an authorized user can permanently delete it for all users.
In the case of a static control (a control that is declared in the markup of an .aspx page), it cannot be deleted, although an authorized user can close the control for all users.
|
Individual users can not personalize properties scoped as Shared. They can personalize User-scoped properties, and their values for these properties take precedence over the property values assigned when the page was in Share scope. If the user-specific personalization data on a control is lost or reset, User-scoped properties revert to the values they had when the page was in Shared scope.
Individual users can close a shared control for themselves, which adds it to the Page Catalog, but they cannot permanently delete it.
|
per-user control
|
The control cannot be personalized with the page in Shared scope, because the control does not even appear on the page. The control only appears when the page is in User scope.
|
Individual users can personalize both Shared and User scoped personalizable properties on the control for themselves, because the control instance is completely private.
Individual users can also permanently delete the control.
|