// Articles. Tutorials. Utilities.
Home  |   Search  |   Login  
Categories Skip Navigation Links
New / All
Google / Android
Python / IronPython
SQL Server
How are the client side JS files for MS AJAX organized?
Microsoft has made MS AJAX open-source. That means, both the server-side and the client-side code is available on your computer when you install MS AJAX. This article looks at where to look for those files.
Table of Contents

Client-Side AJAX files

Related Articles


Client-Side AJAX files

If you installed the MS AJAX at its default location, you can find six .js files in the following location:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\MicrosoftAjaxLibrary\System.Web.Extensions?.0.61025.0

This directory contains the release and debug versions of the client-side JavaScript files:


On the production (release) environments the above js files get downloaded to the client machine. However, since they are stripped off all the comments and line breaks, they are not read-friendly. However, if you want to read and understand these files, you can open up the debug versions of these files in the same directory:


The size of the release version of these files (i.e. the comments stripped and line breaks taken out) is reduced by 50-67% over the size of the debug version. The sizes of the debug and release versions of these files are shown below:

MicrosoftAjax.js 254KB vs. 82KB (67% reduction)
MicrosoftAjaxTimer.js 6KB vs. 3KB (50% reduction)
MicrosoftAjaxWebForms.js 65KB vs. 29KB (55% reduction)

Typically the JavaScript files in the old days used to be sparsely commented because that would add to the download time this would be downloaded for each user (and in some situations for each access). However, in this case, the comment-stripping mechanism is added to these libraries, and hence the release files are not longer than necessary.

Removing the newline/linebreak characters not only reduces the size of the file, it also makes it difficult to the power user / another developer ‘reverse-engineer’ your code. If you open the release version of MicrosoftAjax.js file, the first code line stretches on to 80 thousand characters. Without a lot of time in one’s hands, it would be difficult to make sense of the code (Obviously, the obfuscation is not the aim in case of Microsoft Ajax library – the fully-documented source code is available).

What we discussed above is the client side source code (the JavaScript code). However, MS AJAX has both client-side and server-side components to it. The server-side code is written in C# and is available at the following location:

C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\Source

Related Articles

How does the MicrosoftAjax.js provide the basic AJAX functionality?

Bookmark and Share This

More Articles With Similar Tags
Since JavaScript has been supported by every major web browser for a long time now, every decent-sized web site uses some JavaScript. Now that ASP.NET AJAX is available, you might want to refactor and start adding some of the functionality available in these libraries. This article goes through the initial refactoring steps.
ASP.NET AJAX client side libraries provide a Sys.Browser class. This class along with objects like Sys.Browser.InternetExplorer can be used to detect the browser that the current page is running on. This article discusses the browser detection from the client side.
Since JavaScript is a loosely-typed language, type checking is not done for you automatically. If you are writing library-type functions (those that would be used by other developers), it is very useful to validate the parameters. Here is how MS AJAX does the parameter validation.
It would be very useful to have counter right next to the textbox and increase that number as the user is typing into that textbox. Based on the lengths of the string entered into the textbox we could change the background of the textbox (white, yellow, red). This can be done in JavaScript (on MS AJAX) with relatively a few lines of client-side code.
This article looks at how a control written with MS AJAX gets initialized on the client side. Discusses the JavaScript methods from the client-side library that get called in the initialization of the control. The example used here is the creation of an instance an autocompleteextender control.
About  Contact  Privacy Policy  Site Map