The AJAX Cascading Dropdown control extender in also a family member of AJAX control toolkit that provides the functionality to populate the Dropdownlist control of ASP.Net 2.0 in a sequence of relation to each other. For example if you want to fill the dropdown control in sequence like dropdown populated with list of countries, select a country to fill the related dropdown with list of states of the selected country and then populate the other dropdown with list of cities related to selected state.
Cascading Dropdown control works with a web service that returns the result according to the call made by CascadingDropdown extender control. Cascading Dropdown control consists of properties to attach two dropdown controls with extender. One dropdown call the web service method on its selected index change event and fills the associates dropdown control with results retrieved from that web service method.
TargetControlID: ID of the dropdown control of ASP.Net 2.0 that will initialize the cascading behavior of dropdown controls.
ParentControlID: ID of the parent dropdown control that will populate the target dropdown control on its selection change. ParentControlID is an optional property, but you must specify the ID of the parent control in second cascading dropdown control that will get populated on selected index change of parent dropdown control.
PromptText: Initial Text value that will prompt to select the value from the dropdown.
Category: name of the category to which the target control belongs to. This property value helps in calling the conditional action to retrieve the result.
EmptyText: To display the text when there is no data in the dropdown control.
EmptyValue: Value property for the EmptyText.
LoadingText: To display the Text message while retrieving the result set from the database.
SelectedValue: Value to select by default when control loads initially.
ServicePath: Path of the attached web service.
ServiceMethod: name of the web method that will return the result set. Following is an example of web method to retrieve the results for Cascading Dropdown. You can change the name of the web method but you have to use the same name and datatype for the web method parameters and return type.
[WebMethod] public CascadingDropDownNameValue[] GetDropDownContents(string knownCategoryValues, string category)
[/code]
Also specify [System.Web.Script.Services.ScriptService()] to call the web service method through Cascading Dropdown extender control.
Learn the syntax and how to use Cascading Dropdown extender with XML data...
Be the first to rate this post
Tags: asp.net 2.0, ajax, ajax cascading dropdown control, asp.net ajax control toolkit, cascading dropdown extender, dropshadow extender, accordion extender
10/11/2008 3:43:46 AM