Hi everyone in this blog I’m explaining about Ajax workflow.
In 2003, all the major browsers adopted the XMLHttpRequest (XHR) object that allowed browsers to communicate with the server directly without a page reload.
So it's an overhead for developers to make implementation of XMLHttpRequest universal.
How it works?
- On the server side, we have a WCF service endpoint enabled for AJAX/JSON communications. The incoming message, after its JSON deserializing is forwarded to the workflow instance queue based on the Interface contract. Note, all layers are also configured by the knowledge base.
- The response from the service is received in the AJAX callback handler in a non-blocking process.
4. Hosting and plumbing WCF and WF models is very smoothly implemented in the .NET Framework 3.5 (beta version). There are two additional context driven workflow activities for Send and Receive messages based on the Interface contract.
Advantages of AJAX based application:
1. Improved application performance by reducing the amount of data downloaded from the server
2. Rich, responsive and Slick UI with no page flickers
3. Eliminates frequent page refresh which usually happens in a typical request/response model (Everything is updated on fly)
4. Easy to implement as there are variety of AJAX implementations available around
5. AJAX mechanism works behind the scene nothing much required from user perspective
6. Works with all browsers
7. Avoids the round trips to the server
8. Rendering of webpage faster
9. Decreases the consumption of server resources
10. Response time of application is very faster
11. Rendering of data is dynamic
So let us start with the basic concepts of Ajax Extension which comes with the ASP.Net Framework.
Using Ajax Extension
The following are the most commonly used Ajax controls in an ASP.Net Application which comes with the ASP.Net Framework and available under the Ajax Extension tab of ASP.Net Toolbox present at the left hand side of Microsoft Visual Studio framework.
These controls are:
- 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.
in my next post i'll explain about Post data With Ajax and ASP.NET MVC