For now MainPage is the requirement nxAjax library has to work as it does.

MainPage inherits from AjaxPage (How inherits from Microsoft framework System.Web.UI.Page). And it overwrites much of its functionality.

Clears all javascripts from Microsoft, transforms the format of the form, add the javascript library (jQuery, internals, ...) and processes requests in a way that the library can understand.

The viewstate is stored in session varibles so it is no longer on the served page. MainPage removes doPostBack functions and VIEWSTATE hidden input.

And it also provides a new template and multilanguage systems.


A ContainedPage only be loaded into a container control (Framework.Ajax.UI.Controls.Container). And again in a MainPage.

It inherits from AjaxPage (How inherits from Microsoft framework System.Web.UI.Page). But unlike her older sister MainPage not load any scripts. So it is dependent.

ContainedPage is the tool we use to dynamically load content from Ajax on our website.


AjaxUserControl works like System.Web.UI.UserControl. But if you want load dynamically content, it is better to use ContainedPage.


AjaxControl server control is the base of the entire nxAjax library. Every control inherits from this.

To render an AjaxControl we use two methods: RenderHTML and RenderJS. The first writes the HTML code that we see on the Web. And the second renders the javascripts used for initialization and status changes.

To avoid overload, the HTML rendering uses an internal cache for each instance of the control. And only it is written once, when the page is loaded the first time.

Then rendering javascripts comes into play. It is launched the first time and then on each postback which change its status.

To force an status change or otherwise use the funcitons AjaxUpdate and AjaxNotUpdate.

Every AjaxControl postback has two methods, synchronous and asynchronous. The default is Sync.

In the synchronous call context is used an ajax queue. Here it is adding requests to be loaded sequentially. If you want during the server process, a loading screen is showed, add in MainPage a div object with id="loading".

Asynchronous calls are made for each of the controls at the time of requesting. PostBackMode property specifies it. And if you want to add a loading image while processing the request, you can set the properties: LoadingImg (Image source) or LoadingImgID (Image Control ID).

AjaxControl postback only posts the current control value. If you want to post all form content you should use ISubmit control (like Submit or LinkSubmit).

Finally, AjaxPage property gets the container page: ContainedPage or MainPage.

Last edited Feb 9, 2010 at 10:14 AM by fescolar, version 2


No comments yet.