Available for download
. Net often uses a three-level provincial/municipal LinkageCode, I dragged these files out. You can use them directly by referring to the following.
It can help. NET developers save time
Help:
1. Add HTML controls to the foreground
<Script language = "JavaScript" src = "JS/PCA. js"> </SCRIPT>
<! -- Province, city -->
<Input id = "lbl_provice" type = "text" runat = "server" style = "display: none" value = "Zhejiang">
<Input id = "lbl_city" type = "text" runat = "server" style = "display: none" value = "Hangzhou">
<Input id = "lbl_area" type = "text" runat = "server" style = "display: none">
Drag and Drop three dropdownlist controls at the front end: dropdownlist1, dropdownlist2, and dropdownlist3
2. Add code on the CS page
Copy the code in XML of Ajax-level three provincial/municipal linkages to your project-> In class1.cs
REFERENCE The namespace using system. xml at the same time;
Add
Ajax. Utility. registertypeforajax (typeof (Register); // register refers to the class name of your page. If you change it, replace the class name called in PCa. js.
Binddropdownlist ();
3. Copy the chinaarea. xml file to your project and directory.
4. Configure Ajax in Web. config
<System. Web>
<Httphandlers>
<Add verb = "post, get" Path = "ajax/*. ashx" type = "Ajax. pagehandlerfactory, Ajax"/>
</Httphandlers>
</System. Web>
Demo download