Explanation:
What is AJAX and Microsoft AJAX Library?
AJAX stands for Asynchronous JavaScript
and XML. JavaScript, though, is a simple programming
language whose foundation was laid out quite a few years ago when object-oriented
programming was considered overkill for Web pages. At the same time, principles
of dynamic languages were considered too academic to be fully implemented in a broadly
used programming language.
JavaScript is actually
the client side implementation. It is primarily used to embed functions in HTML
pages that glue together a user's actions with elements in the page. Document Object
Model (DOM) is the schema for the controls or elements in the page—buttons,
textboxes, and so on. With JavaScript, you can programmatically rename, edit, add,
or delete elements in the displayed document and handle any events fired by such
elements. In addition, you can perform any browser-specific action, such as opening
or popping up a new window or—what makes AJAX so special—invoke the
popular XMLHttpRequest object and place asynchronous calls to a
remote URL.
JavaScript is the minimal
required language for programmers who want to fix some actions in the web page but
as whole it is not a sophisticated language which supports classes, Inheritance
and interfaces.
AJAX on the other hand manipulates
the XMLHttpRequest object and creates connection between a client
and the data and objects lying on the server side. The main idea after AJAX is to
decrease the traffic of unwanted data which also saves the time and improves the
user internet browsing experience.
Introducing
the Microsoft AJAX Library
The Microsoft AJAX
Library itself is self-contained, written in JavaScript, and stored in a couple
of .js files. This means that any programming environment that accepts JavaScript
can successfully use the Microsoft AJAX Library provided that the constituent files
are properly referenced. There are two main files involved in the Microsoft AJAX
Library: MicrosoftAjax.js and MicrosoftAjaxWebForms.js. MicrosoftAjax.js defines
language extensions supported by the Microsoft AJAX Library including namespaces,
interfaces, enums, and inheritance. MicrosoftAjaxWebForms.js defines the partial
rendering engine and the whole network stack.
In an ASP.NET AJAX
application, you don't need to reference or embed any of these two files directly.
This is one of the tasks that the ScriptManager control accomplishes for you:
<asp:ScriptManager runat="server"
ID="ScriptManager1" />
Placed in an ASP.NET
AJAX page, the preceding code guarantees that one or both of the Microsoft AJAX
Library .js files will be downloaded to the client. If you're going to extend the
capabilities of the browser's JavaScript in the context of a non-ASP.NET AJAX application,
then you are going to have to reference any required .js files explicitly:
<head><script src="microsoftajax.js"></script></head>
The source code of the Microsoft AJAX Library is located at
ajax.asp.net/downloads.
You can modify these scripts in your own pages.
|