Hi,
What's the difference between using a callback event handler and a method defined as a WebMethod? One major difference I see is that a callback event involves some aspects of the page lifecycle. When is one advisable to be used over the other?
Thanks.
Hi,
On client side, the difference isn't very big. Both of them will use xmlHttpRequest to send to request to the server.
But it's different on server side. When work with callback, a new instance of the page is created to server the request, and a corresponding method defined in it will be fired. While with web method, no instance of page will be created, instead, an instance of the web service is created.
The latter one is a light-weighted way.
No comments:
Post a Comment