AJAX Page - Callback data asynchronous / synchronous

The new AJAX Page ASP.NET control can make a callback with data to the server in two ways:
- synchronously
- asynchronously


synchronous callback

· sequential/serial

· call the post method using two arguments

· the client waits for the server response before continuing

· your script may hang and block your page in case of server error

· See also how to callback data synchronously.

asynchronous callback

· non-sequential/paralel

· call the post method using three arguments

· the client sends the request to server and continues its execution

· you avoid your script hanging and blocking the page in case of server error

· See also how to callback data asynchronously.

Callback data synchronously

If you are sending the data synchronously, the script stops until it receives an answer from the server.

If you need to execute the callback and process the response sequentially, then this is the approach you need.

The syntax is:

        ob_post.post("ProcessPage.aspx", "myServerMethod");
		
where ProcessPage.aspx is the file on server where data will be called back and processed (use null to send data to the same page), themyServerMethod is the public server-side method called.

Please check the synchronous example to see how this method works.

Callback data asynchronously

If you are sending the data asynchronously, the script continues to run while it waits for an answer from the server.

If you are sending a large amount of data, or if the time required for processing the data is pretty long, then the best way to deal with this is by making a callback with the data asynchronously.

After you make a callback with the data you can continue working on your page.
When the callback is done, it automatically calls the function you specified.
This function is a client-side function and it must be implemented in your file.
If something happens while sending/receiving data from your server (such as a bad network connection),
you avoid your script hanging and blocking the page.

The syntax is:

        ob_post.post(null, "myServerMethod", myFunction);
		
where ProcessPage.aspx is the file on server where data will be called back and processed (use null to send data to the same page), themyServerMethod is the public server-side method to be called and myFunction is the client-side function called when the callback is done.

Please check the asynchronous example to see how this method works.

"My Feedback for Product: The obout GRID control is the best and easiest grid control I have ever used till date. It has all the features that needs to be, within a GRID and it’s so user friendly that even a layman can use it just by drag and drop and few lines of code. My Feedback for Support: Honestly speaking, I had not expected the first response from obout that quickly. I mean, I got the response to my query in less than 20 minutes (which is really amazing) and I was really shock to see that. And also, good to see the way Obout team works to fix the issue so quickly. Please continue do design and develop the best tools that are really helpful for the developers in the IT market."

Rohan Lopes

Random testimonial   All testimonials