示例#1
0
 private void SaveStateData()
 {
     ViewState["mystate"] = new CounterControlState
     {
         LeftValue  = this.LeftValue,
         RightValue = this.RightValue,
     };
 }
示例#2
0
        protected override void LoadControlState(object savedState)
        {
            CounterControlState state = savedState as CounterControlState;

            if (state != null)
            {
                LeftValue  = state.LeftValue;
                RightValue = state.RightValue;
            }
        }
示例#3
0
        private void SaveStateData()
        {
            ViewState["mystate"] = new CounterControlState
            {
                LeftValue  = this.LeftValue,
                RightValue = this.RightValue
            };

            //Session[GetSessionKey("left")] = LeftValue;
            //Session[GetSessionKey("right")] = RightValue;
        }
示例#4
0
        private void LoadStateData()
        {
            CounterControlState state = ViewState["mystate"] as CounterControlState;

            if (state != null)
            {
                LeftValue  = state.LeftValue;
                RightValue = state.RightValue;
            }

            //int temp;
            //if (int.TryParse(GetValue("left"), out temp))
            //{
            //    LeftValue = temp;
            //}
            //if (int.TryParse(GetValue("right"), out temp))
            //{
            //    RightValue = temp;
            //}
        }
示例#5
0
        private void LoadStateData()
        {
            CounterControlState state = ViewState["mystate"] as CounterControlState;

            if (state != null)
            {
                LeftValue  = state.LeftValue;
                RightValue = state.RightValue;
            }

            #region
            //Int32 temp;
            //if (Int32.TryParse(GetValue("left"), out temp))
            //{
            //    LeftValue = temp;
            //}
            //if (Int32.TryParse(GetValue("right"), out temp))
            //{
            //    RightValue = temp;
            //}
            //LeftValue = (Session[GetSessionKey("left")] as Int32?) ?? LeftValue;
            //RightValue = (Session[GetSessionKey("reight")] as Int32?) ?? RightValue;
            #endregion
        }