示例#1
0
        protected override void SavePersonalizationBlob(WebPartManager webPartManager, string path, string userName,
                                                        byte[] dataBlob)
        {
            PageBase page = webPartManager.Page as PageBase;

            if (page != null && page.CurrentUserSession != null)
            {
                userName = page.CurrentUserSession.Username;
                User user = User.Load(userName);

                PersonalizationInfo info = user.PersonalizationInfo;
                string key = String.Format("{0}_{1}_{2}", webPartManager.ID, path, userName);

                if (info == null)
                {
                    info = new PersonalizationInfo();
                }
                info.userPersonalizationData[key] = dataBlob;
                user.PersonalizationInfo = info;
                page.CurrentUserSession.PersonalizationInfo = info;

                user.Update();
            }
        }
示例#2
0
        public void ResetPersonalization()
        {
            _personalizationInfo = null;
            personalizationInfoDeserialized = null;

            Update();
        }