示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (ControlStateValue == 0)
            {
                Assertion.IsFalse(IsPostBack);
                Assertion.IsFalse(IsUserControlPostBack);
            }
            else
            {
                Assertion.IsTrue(IsPostBack);
                Assertion.IsTrue(IsUserControlPostBack);
            }

            Assertion.IsTrue(WxePage.CurrentFunction == this.CurrentFunction);
            Assertion.IsTrue(CurrentFunction is ShowUserControlFormFunction);
            Assertion.IsTrue(WxePage.Variables == this.Variables);

            ViewStateValue++;
            ViewStateLabel.Text = ViewStateValue.ToString();

            ControlStateValue++;
            ControlStateLabel.Text = ControlStateValue.ToString();

            if (!IsUserControlPostBack)
            {
                Assertion.IsNull(SubControlWithState.ValueInViewState);
                SubControlWithState.ValueInViewState = 1.ToString ();

                Assertion.IsNull(SubControlWithState.ValueInControlState);
                SubControlWithState.ValueInControlState = 1.ToString ();
            }
            else
            {
                Assertion.IsNotNull(SubControlWithState.ValueInViewState);
                SubControlWithState.ValueInViewState = (int.Parse(SubControlWithState.ValueInViewState) + 1).ToString();

                Assertion.IsNotNull(SubControlWithState.ValueInControlState);
                SubControlWithState.ValueInControlState = (int.Parse(SubControlWithState.ValueInControlState) + 1).ToString();
            }
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            //var control = Page.LoadControl ("FirstControl.ascx");
            //control.ID = "FirstControl";
            //FirstControlPlaceHoder.Controls.Add (control);

            ViewStateValue++;
            ViewStateLabel.Text = ViewStateValue.ToString();

            ControlStateValue++;
            ControlStateLabel.Text = ControlStateValue.ToString();

            StringBuilder stringBuilder = new StringBuilder();

            for (WxeStep step = CurrentPageStep; step != null; step = step.ParentStep)
            {
                stringBuilder.AppendFormat("{0}<br>", step);
            }
            StackLabel.Text = stringBuilder.ToString();

            if (!IsPostBack)
            {
                Assertion.IsNull(SubControlWithState.ValueInViewState);
                SubControlWithState.ValueInViewState = 1.ToString ();

                Assertion.IsNull(SubControlWithState.ValueInControlState);
                SubControlWithState.ValueInControlState = 1.ToString ();
            }
            else
            {
                Assertion.IsNotNull(SubControlWithState.ValueInViewState);
                SubControlWithState.ValueInViewState = (int.Parse(SubControlWithState.ValueInViewState) + 1).ToString();

                Assertion.IsNotNull(SubControlWithState.ValueInControlState);
                SubControlWithState.ValueInControlState = (int.Parse(SubControlWithState.ValueInControlState) + 1).ToString();
            }
        }
示例#3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (ControlStateValue == 0)
            {
                Assertion.IsTrue(IsPostBack);
                Assertion.IsFalse(IsUserControlPostBack);
            }
            else
            {
                Assertion.IsTrue(IsPostBack);
                Assertion.IsTrue(IsUserControlPostBack);
            }
            Assertion.IsTrue(WxePage.CurrentFunction is ShowUserControlFormFunction);
            Assertion.IsTrue(CurrentFunction is ShowFourthUserControlFormFunction);
            Assertion.IsTrue(WxePage.Variables != this.Variables);

            ViewStateValue++;
            ViewStateLabel.Text = ViewStateValue.ToString();

            ControlStateValue++;
            ControlStateLabel.Text = ControlStateValue.ToString();
        }