I would like to do callback approach.
But I face some problem while calling different Javascript function.
I have no idea to make two different Javascript function to work.
For example, a function as follow
Expand|Select|Wrap|Line Numbers
- string strScript = "function ReceiveServerData(arg, context){ document.getElementById('" + result.ClientID + "').value = arg + ' ' + context + document.getElementById('"+ num1.ClientID +"').value; }";
- Page.ClientScript.RegisterClientScriptBlock(this.GetType), "myscript", strScript, true);
- string cbReference = Page.ClientScript.GetCallbackEventReference(this, "''", "ReceiveServerData", "'222'");
- Button2.Attributes.Add("onclick", cbReference);
Expand|Select|Wrap|Line Numbers
- string addItem = "function receiveData(arg, context){}";
- Page.ClientScript.RegisterClientScriptBlock(this.GetType), "addScript", addItem, true);
- string test = Page.ClientScript.GetCallbackEventReference(this, "''", "receiveData", "'555'");
- Button3.Attributes.Add("onclick", test);
Using one Javascript function is Ok that only write code on RaiseCallbackEvent method and GetCallbackResult method.
Is this callback bottleneck for only one Javascript function?
Could anyone answer my problem.
Thanks for any kindly assistance.
Jim.