concept asynchronous request in category .net

appears as: synchronous requests, n asynchronous request, asynchronous request, Asynchronous requests, asynchronous requests
ASP.NET AJAX in Action

This is an excerpt from Manning's book ASP.NET AJAX in Action.

Listing 1.3. Sending an asynchronous request

Now that the object has been instantiated, you can use it to make an asynchronous request to a server resource. To keeps things simple, you can make a request to another page called Welcome.htm, the contents of which are shown in listing 1.2.

Listing 1.2. Welcome.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Welcome</title> </head> <body> <div>Welcome to ASP.NET AJAX In Action!</div> </body> </html>

Welcome.htm is pretty minimal and contains some static text welcoming you to the book. You make the asynchronous request with a few more lines of code that you wrap in a function called sendRequest (see listing 1.3).

Listing 1.3. Sending an asynchronous request
  • A new Sys.Net.WebRequest object (introduced in chapter 5) is instantiated for the asynchronous request.