Hi,
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
anothor as follows
Now, I want two different buttons(Button2 and Button3) onclick event to do somthing, but i do not know how to implement my RaiseCallbackEv ent method and GetCallbackResu lt method.
Using one Javascript function is Ok that only write code on RaiseCallbackEv ent method and GetCallbackResu lt method.
Is this callback bottleneck for only one Javascript function?
Could anyone answer my problem.
Thanks for any kindly assistance.
Jim.
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
Code:
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'");
[B]Button2.[/B]Attributes.Add("onclick", cbReference);
Code:
string addItem = "function receiveData(arg, context){}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType), "addScript", addItem, true);
string test = Page.ClientScript.GetCallbackEventReference(this, "''", "receiveData", "'555'");
[B]Button3.[/B]Attributes.Add("onclick", test);
Using one Javascript function is Ok that only write code on RaiseCallbackEv ent method and GetCallbackResu lt method.
Is this callback bottleneck for only one Javascript function?
Could anyone answer my problem.
Thanks for any kindly assistance.
Jim.
Comment