private void SaveStateData() { ViewState["mystate"] = new CounterControlState { LeftValue = this.LeftValue, RightValue = this.RightValue, }; }
protected override void LoadControlState(object savedState) { CounterControlState state = savedState as CounterControlState; if (state != null) { LeftValue = state.LeftValue; RightValue = state.RightValue; } }
private void SaveStateData() { ViewState["mystate"] = new CounterControlState { LeftValue = this.LeftValue, RightValue = this.RightValue }; //Session[GetSessionKey("left")] = LeftValue; //Session[GetSessionKey("right")] = RightValue; }
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; //} }
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 }