Hi everyone in this blog I’m explaining about Ajax workflow.
from the server. It was necessary to make a form submission. With each
submission the entire form was being reloaded. So it was loading an entirely
new page and that was making performance slow but in case of Ajax this is
possible from XHR.
In 2003, all the major browsers adopted the
XMLHttpRequest (XHR) object that allowed browsers to communicate with the
server directly without a page reload.
interact with the server. The user can make a request to the server with a HTTP
Get Response from the server and modify the required portion only (without a
form submission/reload). But, various browsers implement it differently. For
example Internet Explorer uses an ActiveXObject whereas other modern browsers
So it's an overhead for developers to make
implementation of XMLHttpRequest universal.
How it works?
- When the user creates an event (for instance, clicking on a
button) on the specific component on the page, its logic implemented by
JSON formatted text, this process activates an AJAX Callback for the
service response and calls the magic
to dispatch a request to the specific endpoint.
- 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
- The response from the service is received in the AJAX callback
handler in a non-blocking process.
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
Advantages of AJAX based application:
application performance by reducing the amount of data downloaded from the
responsive and Slick UI with no page flickers
frequent page refresh which usually happens in a typical request/response model
(Everything is updated on fly)
to implement as there are variety of AJAX implementations available around
mechanism works behind the scene nothing much required from user perspective
with all browsers
the round trips to the server
of webpage faster
the consumption of server resources
time of application is very faster
of data is dynamic
let us start with the basic concepts of Ajax Extension which comes with the
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:
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
- Using Update
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.
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