What is the difference between a callback and a postback?
A callback is a special postback, so a round-trip always occurs; however, unlike the classic postback, the script callback doesn’t redraw the whole page. ViewState is not updated during a callback, it is for postback.
How to make a callback?
How does the ASP.NET runtime know this HTTP request is a Callback rather than a Postback?
After the ASP.NET runtime get a HTTP request, it looks for a __CALLBACKID entry in the Request collection. If such an entry is found, the runtime concludes that a callback invocation is being made.
public string GetCallbackEventReference(string target, string argument,
string clientCallback, string context,
there are overloads such as
ClientScriptManager.GetCallbackEventReference (Control, String, String, String)
ClientScriptManager.GetCallbackEventReference (Control, String, String, String, Boolean)
The name of a server Control that handles the client callback. The control must implement the ICallbackEventHandler interface and provide a RaiseCallbackEvent method (which could be the page itself).
An argument passed from the client script to the server RaiseCallbackEvent method.
The name of the client event handler that receives the result of the successful server event.
Client script that is evaluated on the client prior to initiating the callback. The result of the script is passed back to the client event handler.
The name of the client event handler that receives the result when an error occurs in the server event handler.
true to perform the callback asynchronously; false to perform the callback synchronously.
posted on Friday, April 20, 2007 2:02 AM