Exemplo n.º 1
0
        protected override object LoadPageStateFromPersistenceMedium()
        {
            string viewstate = Request.Form["__CompressedVIEWSTATE"];

            byte[]       data             = Convert.FromBase64String(viewstate);
            byte[]       uncompressedData = ZipState.Decompress(data);
            string       str       = Convert.ToBase64String(uncompressedData);
            LosFormatter formatter = new LosFormatter();

            return(formatter.Deserialize(str));
        }
Exemplo n.º 2
0
        protected override void SavePageStateToPersistenceMedium(object state)
        {
            LosFormatter formatter = new LosFormatter();
            StringWriter writer    = new StringWriter();

            formatter.Serialize(writer, state);
            string viewState = writer.ToString();

            byte[] data           = Convert.FromBase64String(viewState);
            byte[] compressedData = ZipState.Compress(data);
            string str            = Convert.ToBase64String(compressedData);

            ClientScript.RegisterHiddenField("__CompressedVIEWSTATE", str);
        }