- Many round trips to the server.
- Rendering of webpage is slower.
- Increases the consumption of server resources.
- Response time of application is very slower.
- Rendering of data is static.
- Data is updated of an application only when the user clicks on the browser refresh button.
What is Ajax ?
AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the entire page.
We can also define Ajax is a combination of client side technologies that provides asynchronous communication between the user interface and the web server so that partial page rendering occurs instead of complete page post back.
Using Ajax technologies we can observe in Google Maps, Gmail, YouTube, and Facebook tabs.
I hope you have understood the basic concepts of Ajax. Now let us see the following diagram showing how Ajax works:
AJAX is Based on Internet Standards
Let us know about the basic information each technology uses in Ajax.
1. XHTML and CSS
The Document Object Model is a platform and language independent standard object model for representing HTML or XML.
XML is typically used as the format for transferring data between the server and the client. Using XML we can represent any applicable data object structure we might wish to represent.
- In Ajax Client and Server Communication done with help of HttpRequest.
- AJAX applications are browser and platform independent.
ASP.NET AJAX integrates client script libraries with the ASP.NET 2.0 development framework. This new Web development technology extends ASP.NET, offering the interactive user interface benefits of AJAX with a programming model that is more familiar to ASP.NET developers, making it very easy to add AJAX to your applications quickly and with minimal effort.
Power of Ajax
- The power of AJAX lies in its ability to communicate with the server asynchronously, using a XMLHttpRequest object without requiring a browser refresh.
- Improved application performance by reducing the amount of data downloaded from the server
- Rich, responsive and Slick UI with no page flickers
- Eliminates frequent page refresh which usually happens in a typical request/response model (Everything is updated on fly)
- Easy to implement as there are variety of AJAX implementations available around
- AJAX mechanism works behind the scene nothing much required from user perspective
- Works with all browsers
- Avoids the round trips to the server
- Rendering of webpage faster
- Decreases the consumption of server resources
- Response time of application is very faster
- Rendering of data is dynamic
- Using ScriptManager
When we use any Ajax control then there is a requirement to use the ScriptManager to handle the Scripting on the client side; without the ScriptManager Ajax controls are not run. So it's a requirement to use the ScriptManager.
- Using UpDatePanel
Update panel is one of the most commonly used Ajax controls which is responsible for updating the particular requested content of the page instead of the entire page which is not requested. The ASP.Net controls are put under the update panel to make the benefit of this control. The ASP.Net controls which are kept under the update panel will be updated when the user clicks on a particular ASP.Net Control which are used in an application.
You can use multiple update panels on a single web page.
- Using Timer
The Timer is also one of the important controls; by using it we can update the particular content of the page automatically without clicking the browser refresh button. The Timer control is used along with the Update Panel so the Contents put under the update panel are automatically updated according the timing set under the timer_click event.
- Using Update Progress
This control is used to notify the user to wait until the requests are processed on the server. Update progress control is used when the user clicks on any tab or control of an application. At that time the progress bar is shown which is the interval between the times taken by the server to process the client request.
- Using ScriptManagerProxy
When you need to reference a service from your content page and yet the ScriptManager resides on the Master Page use a ScriptManagerProxy. The ScriptManagerProxy works by detecting the main ScriptManager on your page at runtime and hooking itself to that ScriptManager, making sure that any references given to it are also given to the real ScriptManager.
- Using Pointer
This Ajax Control used to specify the style of the mouse pointer such as arrow, thumb, and progress bar and much more. The above is the basic introduction about the Ajax Extension controls which are available by default in a Microsoft Visual Studio Framework.
In this first part of article I have explained the basics of Ajax. In my next article of the series, Using Ajax Extension :Part-2, I will explain how to use Ajax Extension controls in an ASP.Net C# web application.