ASP.NET page with XML-HTTP JavaScript AJAX
The following ASPX page implements on the client side the most simple JavaScript AJAX mechanism for both GET and POST requests, using the XML-HTTP browser-specific object. On the server side, it can respond to the AJAX requests by sending back the current date and time. Everything appears within a simple aspx file, with no code behind. The HTML shows one text entry field and two buttons: GET and POST. On any button action, an AJAX request is sent to the same page, which sends back the value entered in the text field, followed by the current server date and time, information which will be displayed below the form. The server-side script has the C# Page_Load method, which checks whether or not the page must answer to an AJAX request. The client-side script has the specific JavaScript function onSubmit, called on a button click, which issues a GET or POST AJAX request and waits for the response.

