Roy,
the Documentation for GetCallBackEven tReference describes all the parameters
and even provides code samples:
http://msdn2.microsoft.com/library/m...us,vs.80).aspx
"Context" is the client-side script that is evaluated on the client prior to
initiating the callback. The result of the script is passed back to the
client-side event handler.
The example shows the creation (excerpt):
// Define one of the callback script's context.
// The callback script will be defined in a script block on the page.
StringBuilder context1 = new StringBuilder() ;
context1.Append ("function ReceiveServerDa ta1(arg, context)");
context1.Append ("{");
context1.Append ("Message1.inne rText = arg;");
context1.Append ("value1 = arg;");
context1.Append ("}");
// Define callback references.
String cbReference1 = cs.GetCallbackE ventReference(t his, "arg",
"ReceiveServerD ata1", context1.ToStri ng());
String cbReference2 = cs.GetCallbackE ventReference(" '" +
Page.UniqueID + "'", "arg", "ReceiveServerD ata2", "",
"ProcessCallBac kError", false);
String callbackScript1 = "function CallTheServer1( arg, context) {" +
cbReference1 + "; }";
String callbackScript2 = "function CallTheServer2( arg, context) {" +
cbReference2 + "; }";
// Register script blocks will perform call to the server.
cs.RegisterClie ntScriptBlock(t his.GetType(), "CallTheServer1 ",
callbackScript1 , true);
cs.RegisterClie ntScriptBlock(t his.GetType(), "CallTheServer2 ",
callbackScript2 , true);
--Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roy" wrote:
From the MS site:
NAME: ClientScriptMan ager.GetCallbac kEventReference (Control, String,
String, String)
DESCRIPTION: Obtains a reference to a client-side function that, when
invoked, initiates a client call back to a server-side event. The
client-side function for this overloaded method includes a specified
control, argument, client-side script, and context.
What is "context?"
Thanks
*** Sent via Developersdex http://www.developersdex.com ***