Exemplo n.º 1
0
		public void ClientScriptManager_GetCallbackEventReference_1 ()
		{
			MyPage p = new MyPage ();
			ClientScriptManager cs = p.ClientScript;
			StringBuilder func = new StringBuilder ();
			func.Append ("function ReceiveServerData1(arg, context)");
			func.Append ("{");
			func.Append ("Message1.innerText =  arg;");
			func.Append ("value1 = arg;");
			func.Append ("}");

			// Define callback references.
			String cbReference = cs.GetCallbackEventReference (p, "callArg",
			    func.ToString (), "ReceiveServerData1Ctx");
			Assert.IsTrue (cbReference.IndexOf ("callArg") != -1, "GetCallbackEventReferenceFail1_arg");
			Assert.IsTrue (cbReference.IndexOf (func.ToString ()) != -1, "GetCallbackEventReferenceFail1_callback");
			Assert.IsTrue (cbReference.IndexOf ("ReceiveServerData1Ctx") != -1, "GetCallbackEventReferenceFail1_context");
		}
Exemplo n.º 2
0
		public void ClientScriptManager_GetCallbackEventReference_2 ()
		{
			MyPage p = new MyPage ();
			ClientScriptManager cs = p.ClientScript;
			StringBuilder func = new StringBuilder ();
			func.Append ("function ReceiveServerData1(arg, context)");
			func.Append ("{");
			func.Append ("Message1.innerText =  arg;");
			func.Append ("value1 = arg;");
			func.Append ("}");

			// Define callback references.
			String cbReference = cs.GetCallbackEventReference (p, "callArg",
			    func.ToString (), "ReceiveServerData1Ctx", true);
			Assert.IsTrue (cbReference.IndexOf ("callArg") != -1, "GetCallbackEventReferenceFail2_arg");
			Assert.IsTrue (cbReference.IndexOf (func.ToString ()) != -1, "GetCallbackEventReferenceFail2_callback");
			Assert.IsTrue (cbReference.IndexOf ("ReceiveServerData1Ctx") != -1, "GetCallbackEventReferenceFail2_context");
			String cbReference2 = cs.GetCallbackEventReference (p, "arg",
			    func.ToString (), "ReceiveServerData1Ctx", false);
			// Check that we get different results when useAsync differs.
			Assert.IsTrue (cbReference != cbReference2, "GetCallbackEventReferenceFail2_useAsync");
		}
Exemplo n.º 3
0
		public void ClientScriptManager_GetPostBackClientHyperlink ()
		{
			MyPage p = new MyPage ();
			ClientScriptManager cs = p.ClientScript;
			String hyperlink = cs.GetPostBackClientHyperlink (p, "args1");
			Assert.IsTrue (hyperlink.IndexOf("javascript:") != -1, "GetPostBackClientHyperlink_javaScript");
			Assert.IsTrue (hyperlink.IndexOf(p.ClientID) != -1, "GetPostBackClientHyperlink_targetEvent");
			Assert.IsTrue (hyperlink.IndexOf("args1") != -1, "GetPostBackClientHyperlink_targetArgs");
		}
Exemplo n.º 4
0
		public void ClientScriptManager_GetPostBackEventReference_2 ()
		{
			MyPage p = new MyPage ();
			ClientScriptManager cs = p.ClientScript;
			String result = cs.GetPostBackEventReference (p, "args1");
			Assert.IsTrue (result.IndexOf(p.ClientID) != -1, "GetPostBackEventReference#2_targetEvent");
			Assert.IsTrue (result.IndexOf("args1") != -1, "GetPostBackEventReference#2_targetArgs");
		}