0

We can enable Shared PersonalizationScope on runtime for Webpart manager using following codebehind code:

if ((webpartManagerId.Personalization.Scope == PersonalizationScope.User) && (webpartManagerId.Personalization.CanEnterSharedScope))
{
    webpartManagerId.Personalization.Scope = PersonalizationScope.Shared;
}

I need to do this on all pages. But doing this will again reload the Page to make the webpart in Shared Scope and will break other things and cause the page loading slow.

Is there any config settings, by which I can make all pages/Webpartmanagers to go in Shared scope as default?

1 Answer 1

0

Finally, I got it working to make the default scope as Shared. Rather then using System.Web.UI.WebControls.WebParts.WebPartManager control in .aspx page directly. Inherit this control and set the default value in consturcted to save loading time:

public class CustomWebPartManager : WebPartManager
{
    public CustomWebPartManager()
    {
       Personalization.InitialScope =  PersonalizationScope.Shared;
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.