Finishing an ASP.NET AJAX-based Application
(Page 1 of 4 )
In this third part of a three-part article, we finish our examination of three possible patterns for constructing a web application. To refresh your memory, we considered the pros and cons of each solution, and focused on rebuilding a legacy ASP.NET 2.0 web application in an AJAX format.
A
downloadable .rar file is available for this article.
Using the CascadingDropDown Control to Join Together Multiple DropDownList Controls
CascadingDropDown is one of the exciting server controls through which we can easily join together multiple ASP.NET 2.0 DropDownList controls. Now we will use this control to reconstruct the jobsearch.aspx page, where there are two DropDownList controls to let users select the job-related country and state, as illustrated in the following Figure 4.

Figure 4 The pre-modified snapshot for the jobsearch.aspx page.
Here, the initial state of the first DropDownList is set to "Not Set." When users select a country from this control, a post back will be automatically invoked to obtain the state list of the related country and populate the second DropDownList control with these data for users to select further.
Apparently, the above design will result in low efficiency -- the post back after selecting a country will dramatically diminish the fluency of the application. Furthermore, with quite a few web pages utilizing this whole-page post back action to let users input information about countries and states, this is a pretty unprofessional measure.
With this drawback, we should reconstruct. The simplest method is to enclose the two DropDownList controls with an UpdatePanel control, which is of course simple and effective, but still not highly efficient. For now, clever readers may have remembered the ASP.NET AJAX Control Toolkit control named CascadingDropDown. The CascadingDropDown control is efficient in dealing with this kind of associated dropdown list since it merely gets the necessary data from the server side. For more details about CascadingDropDown, you can refer to the online tutorials.
Next: Authoring the Web Service to Supply with Data >>
More ASP.NET Articles
More By Xianzhong Zhu