I have been searching for half a day on Baidu. No one answered such a question positively. Here I will share my experience.
How to Use the Ajax control cascadingdropdown to implement multi-level linkage binding.
There are many multi-level linkages on the Network (simple: Secondary linkage, for example, the first dropdown is the province, and the first dropdown is the city). This is omitted.
This section describes how to rebind the stored data to the Ajax control.
Prerequisites: 1. I used sqldatasource to bind the "Province", and used Ajax: cascadingdropdown to map the "city ".
2. The city data comes from the web service. When the province is selected, the sub-market that saves the return value is sent to the web service.
Step: 1. Bind the Save value of the province to the event after the province is bound
Protected void ddldivisions_databound (Object sender, eventargs E)
...{
Ddldivisions. Items. findbyvalue (profile. approvalfilterparameters. divisionid. tostring (). Selected = true;
}
2. Set the selectvalue of CDD (cascadingdropdown) in advance in page_load, set the set first, and hit this data subset. If (! Ispostback)
...{
If (profile. approvalfilterparameters. Saved)
Cddoffices. selectedvalue = profile. approvalfilterparameters. officeid. tostring ();
}
In this case, on the client side, the Ajax control will automatically retrieve the province settings, retrieve the child set from the Web service, and then bind the "city" drop down, but because selectedvalue has been set before, in this way, the multi-level linkage can be re-bound.
The meeting is not difficult, but not difficult.
This little thing made me research from the life cycle in the afternoon.
If you can help everyone, give a comment and write it yourself, which is messy.