Provider. Determine Initial Scope(WebPartManager, PersonalizationState) Method
public: virtual System::Web::UI::WebControls::WebParts::PersonalizationScope DetermineInitialScope(System::Web::UI::WebControls::WebParts::WebPartManager ^ webPartManager, System::Web::UI::WebControls::WebParts::PersonalizationState ^ loadedState);
public virtual System.Web.UI.WebControls.WebParts.PersonalizationScope DetermineInitialScope (System.Web.UI.WebControls.WebParts.WebPartManager webPartManager, System.Web.UI.WebControls.WebParts.PersonalizationState loadedState);
abstract member DetermineInitialScope : System.Web.UI.WebControls.WebParts.WebPartManager * System.Web.UI.WebControls.WebParts.PersonalizationState -> System.Web.UI.WebControls.WebParts.PersonalizationScope override this.DetermineInitialScope : System.Web.UI.WebControls.WebParts.WebPartManager * System.Web.UI.WebControls.WebParts.PersonalizationState -> System.Web.UI.WebControls.WebParts.PersonalizationScope
The personalization state information.
The page associated with
This method determines whether the current scope should be Shared or User, given a reference to a WebPartManager control and the personalization state information that has already been loaded from earlier in the personalization life cycle. This information is used by a WebPartPersonalization instance for subsequent personalization-related tasks.
The following rules are used to determine personalization scope:
Scope is assumed initially to be User.
If the currently executing user account is not authenticated, the scope is set to Shared.
If the currently executing user account is authenticated, additional processing occurs in order of precedence:
If the page is in postback mode, the page request contains scope information from a previous rendering of the page. If that scope information indicates that Shared scope was used, then the scope evaluates to Shared.
If the currently executing page had control transferred to it from another page (for example, if the transfer of control occurred due to calling the Transfer method; note that this specific check does not occur for cross-page posting), and if the previously executing page had a WebPartManager instance, the scope is set to the value of the
Personalization.Scopeproperty from the previous WebPartManager instance.
After the previous evaluations have been made, and if the scope evaluates to Shared scope, the following processing occurs:
If the result of all previous scope evaluations is Shared, this result is stored as a hidden field on the currently executing page. This is the mechanism whereby a page can replay the scope evaluation during subsequent postbacks.