if (Webpartmanager1.Personalization.Scope == PersonalizationScope.User
   && Webpartmanager1.Personalization.CanEnterSharedScope)
{                
     Webpartmanager1.Personalization.ToggleScope();
}
