Example #1
0
        public void DataBind_ChildControlsCreated()
        {
            Page p = new Page();
            MyCompositeDataBoundControl c = new MyCompositeDataBoundControl();

            p.Controls.Add(c);
            Assert.IsFalse(c.GetChildControlsCreated(), "ChildControlsCreated before DataBind");
            c.DataBind();
            Assert.IsTrue(c.ensureCreateChildControls);
            Assert.IsTrue(c.createChildControls1);
            Assert.IsTrue(c.createChildControls2);
            Assert.IsTrue(c.CreateChildControls_ChildControlsCreated, "ChildControlsCreated in CreateChildControls");
            Assert.IsTrue(c.GetChildControlsCreated(), "ChildControlsCreated after DataBind");
        }
		public void DataBind_ChildControlsCreated () {
			Page p = new Page ();
			MyCompositeDataBoundControl c = new MyCompositeDataBoundControl ();
			p.Controls.Add (c);
			Assert.IsFalse (c.GetChildControlsCreated (), "ChildControlsCreated before DataBind");
			c.DataBind ();
			Assert.IsTrue (c.ensureCreateChildControls);
			Assert.IsTrue (c.createChildControls1);
			Assert.IsTrue (c.createChildControls2);
			Assert.IsTrue (c.CreateChildControls_ChildControlsCreated, "ChildControlsCreated in CreateChildControls");
			Assert.IsTrue (c.GetChildControlsCreated (), "ChildControlsCreated after DataBind");
		}