Beispiel #1
0
        private object InnerLoadPageStateFromPersistenceMedium()
        {
            object result = null;

            ViewStatePersistSettings settings = ViewStatePersistSettings.GetConfig();

            try
            {
                if (settings.Enabled)
                {
                    PageStatePersister persister = settings.Persister;

                    this.PageStatePersister.Load();
                    persister.Load();

                    result = new Pair(persister.ControlState, persister.ViewState);
                }
                else
                {
                    result = base.LoadPageStateFromPersistenceMedium();
                }
            }
            catch (System.Web.HttpException)
            {
                if (Page.IsCallback == false)
                {
                    throw;
                }
            }

            return(result);
        }
Beispiel #2
0
        protected override Object LoadPageStateFromPersistenceMedium()
        {
            PageStatePersister persister = this.PageStatePersister;

            persister.Load();
            string viewState = persister.ViewState.ToString();

            return(new Pair(persister.ControlState, VeiwStateSerialize.Deserialize(viewState)));
        }
Beispiel #3
0
        protected override object LoadPageStateFromPersistenceMedium()
        {
            PageStatePersister persister = this.PageStatePersister;

            persister.Load();

            string viewState = persister.ViewState.ToString();

            byte[]       data             = Convert.FromBase64String(viewState);
            byte[]       uncompressedData = zipHelper.DeCompress(data);
            string       str       = Convert.ToBase64String(uncompressedData);
            LosFormatter formatter = new LosFormatter();

            return(new Pair(persister.ControlState, formatter.Deserialize(str)));
        }
Beispiel #4
0
        /// <summary>
        /// 取出ViewState对象
        /// </summary>
        /// <returns></returns>
        protected override object LoadPageStateFromPersistenceMedium()
        {
            PageStatePersister ps = this.PageStatePersister;

            ps.Load();
            if (ps.ControlState != null)
            {
                ps.ControlState = DeserializeObj((string)ps.ControlState);
            }
            if (ps.ViewState != null)
            {
                ps.ViewState = DeserializeObj((string)ps.ViewState);
            }
            return(new Pair(ps.ControlState, ps.ViewState));
        }