it MS first attempt at supporting Ajax. the current implementation allows
the client to pass one string arg to the server, and the server to return
one string arg.
the easiest way to understand it, is to look at the javascript code it uses.
you will see the javascript uses a XmlHttp (or a hidden iframe) to make an
async call to the webserver. asp.net recognizes the client callback, and
fire the server Callback events.
GetCallbackEventReference just returns javascript code needed to make a
server call. you combine this with your other client javascript to call the
backend. you could bundle it in your own function like:
string cbReference = Page.ClientScript.GetCallbackEventReference(this,
"arg", "ReceiveServerData", "context");
string callbackScript = "function CallServer(arg, context)" +
"{ " + cbReference + "} ;";
Page.ClientScript.RegisterClientScriptBlock(this.G etType(),
"CallServer", callbackScript, true);
then in client script to call the server with:
CallServer("datatosend","context");
then in your client script you define the function called when callback data
is recieved:
function ReceiveServerData(serverResponseArg,context)
{
// do something with server data
}
-- bruce (sqlwork.com)
"Varangian" <of****@gmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com...
Hello there
anyone knows about the new CallbackEventreference?
How does it really work... I made it working through a dropdown list..
I cannot understand how the "string arguments" works... how many
arguments can I pass and in what? how does it relates with the
javascript function"
thanks :)