As a part of registering the client side scripts on the server we generally use the below line
Page.ClientScript.RegisterClientScriptBlock(this.G etType(), "NewAsyncMethod", newFunction.ToString(), true);
where new function is
string
js = Page.ClientScript.GetCallbackEventReference(this, "arg", "OnServerCallComplete", "ctx", "OnServerCallError", true);
//Create a wrapper method
StringBuilder newFunction = new StringBuilder();
newFunction.Append("function StartAsyncCall(arg, ctx) ");
newFunction.Append("{ ");
newFunction.Append(
js);
newFunction.Append(" } ");
// Now register it
Question is :-
What is ctx in GetCallbackEventReference?
There is been only limited description about it that it is just a context. But wot context is it really? WHat need does it server?