All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.


Thursday, September 23, 2010

Enabling AJAX in ASP.NET with No Code

Asynchronous JavaScript and XML (AJAX) One problem with Web development prior to using AJAX is that with both static HTML pages and dynamic ASP.NET pages, every time a the user does something to cause an interaction with the server—click a link or a button, sort a grid, etc.—the server must regenerate the entire page and send it back to the browser. The browser renders the HTML and then waits to repeat the cycle.Figure 1 shows this process. On a complex page, this can cause a considerable amount of unnecessary overhead and wastes bandwidth by sending an entire page over the network, including portions that haven’t changed along with the small amount that has changed. Worst ofall, it keeps Web applications from delivering the clean, efficient interface that users have come to expect from desktop applications. Figure 1. Basic HTTP request and response for a Web page.AJAX solves this problem by bundling technologies that have been around since late in the lastmillennium: JavaScript, XML, and a means of making asynchronous calls to the server out ofband from the usual HTTP request/response. When a client initially requests an AJAX-enabled page, the entire page is requested by the clientand sent to the browser as usual as shown in figure 1, and the browser renders the page normally. The differences begin when the client clicks a page element that is AJAX-enabled. The client doesn’t perform a full post back that once again requests the entire page from the server.Here’s how the AJAX-enabled process works:1. Through client-side JavaScript, the AJAX request uses the browser’s XML Http Request object to request only the changed data for one or more page elements that need to be updated in response to the user’s action. As part of the server request, AJAX provides a callback function to execute when the response is returned from the server.2. The server receives and processes the request asynchronously, meaning that other code on the page is not blocked, and the page remains responsive to the user. The response is formatted as XML.3. Upon receipt of the XML response, XML Http Request executes the callback function. This callback function parses the response data and uses it to update the appropriate page elements. Figure 2 illustrates these steps.

Download Enabling AJAX in ASP.NET with No Code.


Post a Comment