求助
DropDownList 省市联动代码 昨天找了一天也没找到

解决方案 »

  1.   

    这个用JavaScript就可以搞定了。
      

  2.   

    ajax就可以了
    function CallbackCll(response) 

    if (response.value != null) 
    { document.all("DropDownList_province1").length=0;  
    document.all("DropDownList_area1").length=0;     
         var ds = response.value; 
    if(ds != null && typeof(ds) == "object") 

    document.all("DropDownList_province1").options.add(new Option("","")); 
    for(var i=0; i <ds.Tables[0].Rows.length; i++) 
         { 
         var name=ds.Tables[0].Rows[i].Province; 
           var id=ds.Tables[0].Rows[i].Province; 
           document.all("DropDownList_province1").options.add(new Option(name,id)); 
         } 


    return 

    function areaResult() 

    var area=document.getElementById("DropDownList_province1"); var  YR=document.getElementById("Hd_province1"); 
    YR.value=area.value; 
    AjaxMethod.GetCityList(area.value,get_city_Result); 

    function get_city_Result(response) 

    if (response.value != null) 

    document.all("DropDownList_area1").length=0;     
         var ds = response.value; if(ds != null && typeof(ds) == "object") 

    for(var i=0; i <ds.Tables[0].Rows.length; i++) 
         { 
           var name=ds.Tables[0].Rows[i].City; 
           var id=ds.Tables[0].Rows[i].City; 
           document.all("DropDownList_area1").options.add(new Option(name,id)); 
         } 


    return 

    http://topic.csdn.net/u/20090610/13/6c171b8a-587a-4042-a63a-ba3428fb66ea.html
      

  3.   


    c/s更容易了,直接调用selectindexchanged事件就好了。
      

  4.   

    一般这个东西都是BS得啊。
    CS的就直接在省的selectindexchanged里面写市的联动加载就成了啊
    省在加载的时候就填充省就可以了。
      

  5.   

    http://topic.csdn.net/u/20090328/10/909d4d38-9ed9-49eb-81c2-9e74ddfe7bdf.html
      [控件]ChinaRegions   v1.2   中国行政地区二级联动,XML数据驱动,AJAX,服务器控件   
      

  6.   

    这到,居然是CS,那怎么到BS版来发帖。
    同样可以参考11楼的。另,本帖转C#版。
      

  7.   

    这里有封装好的控件,n级联动。
    http://topic.csdn.net/u/20110225/16/1aae774d-e92e-4d1f-9065-61b712063c28.html?44405