Esempio n. 1
0
        public static void UseSubmitBehavior_Load(Page p)
        {
            PokerButton b = new PokerButton();

            b.UseSubmitBehavior = false;
            p.Controls.Add(b);
        }
Esempio n. 2
0
        public static void PostBackUrl_Load(Page p)
        {
            PokerButton b = new PokerButton();

            b.PostBackUrl = "~/MyPageWithMaster.aspx";
            p.Form.Controls.Add(b);
        }
Esempio n. 3
0
        public void GetPostBackOptions()
        {
            PokerButton     b   = new PokerButton();
            PostBackOptions opt = b.GetPostBackOptions();

            Assert.AreEqual(typeof(PokerButton), opt.TargetControl.GetType(), "GetPostBackOptions#1");
        }
Esempio n. 4
0
        public void Button_ViewState()
        {
            PokerButton p = new PokerButton();

            Assert.AreEqual(p.Text, "", "A1");
            p.Text = "Hello";
            Assert.AreEqual(p.Text, "Hello", "A2");

#if NET_2_0
            p.ValidationGroup   = "VG1";
            p.UseSubmitBehavior = false;
            p.OnClientClick     = "ClientClick()";
            p.PostBackUrl       = "PostBackUrl";
            Assert.AreEqual(p.ValidationGroup, "VG1", "A3");
            Assert.AreEqual(false, p.UseSubmitBehavior, "ViewState_UseSubmitBehavior#original");
            Assert.AreEqual("ClientClick()", p.OnClientClick, "ViewState_OnClientClick#original");
            Assert.AreEqual("PostBackUrl", p.PostBackUrl, "ViewState_PostBackUrl#original");
#endif

            object state = p.SaveState();

            PokerButton copy = new PokerButton();
            copy.LoadState(state);
            Assert.AreEqual(copy.Text, "Hello", "A4");

#if NET_2_0
            Assert.AreEqual(copy.ValidationGroup, "VG1", "A5");
            Assert.AreEqual(false, copy.UseSubmitBehavior, "ViewState_UseSubmitBehavior#copy");
            Assert.AreEqual("ClientClick()", p.OnClientClick, "ViewState_OnClientClick#copy");
            Assert.AreEqual("PostBackUrl", p.PostBackUrl, "ViewState_PostBackUrl#copy");
#endif
        }
Esempio n. 5
0
        public void OnPreRender()
        {
            PokerButton b = new PokerButton();

            b.PreRender += new EventHandler(b_PreRender);
            Assert.AreEqual(false, eventPreRender, "Before PreRender");
            b.OnPreRender(new EventArgs());
            Assert.AreEqual(true, eventPreRender, "After PreRender");
        }
Esempio n. 6
0
        public void RaisePostBackEvent()
        {
            Page        p = new Page();
            PokerButton b = new PokerButton();

            b.Click += new EventHandler(b_Click);
            p.Controls.Add(b);
            Assert.AreEqual(false, eventRaisePostBackEvent, "RaisePostBackEvent#1");
            b.RaisePostBackEvent("Click");
            Assert.AreEqual(true, eventRaisePostBackEvent, "RaisePostBackEvent#2");
        }
		public static void UseSubmitBehavior_Load (Page p)
		{
			PokerButton b = new PokerButton ();
			b.UseSubmitBehavior = false;
			p.Controls.Add (b);
		}
		public void RaisePostBackEvent ()
		{
			Page p = new Page ();
			PokerButton b = new PokerButton ();
			b.Click += new EventHandler (b_Click);
			p.Controls.Add (b);
			Assert.AreEqual (false, eventRaisePostBackEvent, "RaisePostBackEvent#1");
			b.RaisePostBackEvent ("Click");
			Assert.AreEqual (true, eventRaisePostBackEvent, "RaisePostBackEvent#2");
		}
		public static void PostBackUrl_Load (Page p)
		{
			PokerButton b = new PokerButton ();
			b.PostBackUrl = "~/MyPageWithMaster.aspx";
			p.Form.Controls.Add (b);
		}
Esempio n. 10
0
		public void OnPreRender ()
		{
			PokerButton b = new PokerButton ();
			b.PreRender += new EventHandler (b_PreRender);
			Assert.AreEqual (false, eventPreRender, "Before PreRender");
			b.OnPreRender (new EventArgs ());
			Assert.AreEqual (true, eventPreRender, "After PreRender");
		}
Esempio n. 11
0
		public void GetPostBackOptions ()
		{
			PokerButton b = new PokerButton ();
			PostBackOptions opt = b.GetPostBackOptions ();
			Assert.AreEqual (typeof (PokerButton), opt.TargetControl.GetType (), "GetPostBackOptions#1");
		}
Esempio n. 12
0
		public void Button_ViewState ()
		{
			PokerButton p = new PokerButton ();

			Assert.AreEqual (p.Text, "", "A1");
			p.Text = "Hello";
			Assert.AreEqual (p.Text, "Hello", "A2");

#if NET_2_0
			p.ValidationGroup = "VG1";
			p.UseSubmitBehavior = false;
			p.OnClientClick = "ClientClick()";
			p.PostBackUrl = "PostBackUrl";
			Assert.AreEqual (p.ValidationGroup, "VG1", "A3");
			Assert.AreEqual (false, p.UseSubmitBehavior, "ViewState_UseSubmitBehavior#original");
			Assert.AreEqual ("ClientClick()", p.OnClientClick, "ViewState_OnClientClick#original");
			Assert.AreEqual ("PostBackUrl", p.PostBackUrl, "ViewState_PostBackUrl#original");
#endif

			object state = p.SaveState ();

			PokerButton copy = new PokerButton ();
			copy.LoadState (state);
			Assert.AreEqual (copy.Text, "Hello", "A4");

#if NET_2_0
			Assert.AreEqual (copy.ValidationGroup, "VG1", "A5");
			Assert.AreEqual (false, copy.UseSubmitBehavior, "ViewState_UseSubmitBehavior#copy");
			Assert.AreEqual ("ClientClick()", p.OnClientClick, "ViewState_OnClientClick#copy");
			Assert.AreEqual ("PostBackUrl", p.PostBackUrl, "ViewState_PostBackUrl#copy");
#endif
		}