Understanding UpdatePanels in ASPajax

ASPajax provides a streamlined tool for A.J.A.X development with minimal new coding: UpdatePanels

UpdatePanels mark a region of any ASP web page to automatically process all forms and links using AJAX. All ASP functionality can now be executed without refreshing the web page.

The structure of your pages and application is not affected. The site will still work without AJAX enabled. This makes light work of W3C Accessibility and XHTML compliance.

In addition an UpdatePanel can execute any Client-Side JavaScript code in the UpdatePanel during AJAX postbacks.

How to develop using UpdatePanels

  • Build all web application functionality as normal..
  • Add ASPajax UpdatePanel regions in your code. This will automatically enable internal forms, links and other ASP actions to occur normally, but without the page refreshing.

Start Programming with UpdatePanels

Once ASPajax is installed it takes 2 steps to add AJAX functionality to your pages.

1 - Include the aspajax.asp file to your page and instantiate it.

E. G:

<!--#include virtual="/aspajax/aspajax.asp"-->
<% ASPAjax.Open ' in the head of your page %>
...
<% ASPAjax.Close ' at the very end of your page %>

2 - Mark regions of the page as a dynamically updateable:

E.G:

<%
Dim myPanel
Set myPanel = ASPAjax.CreateUpdatePanel
myPanel.Id = "Panel1"
myPanel.Open
%>
........your form......
<%
myPanel.Close
%>

Object Reference

Examples of ASPajax UpdatePanels