DropDownList 联动问题 求助DropDownList 省市联动代码 昨天找了一天也没找到 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个用JavaScript就可以搞定了。 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 c/s更容易了,直接调用selectindexchanged事件就好了。 一般这个东西都是BS得啊。CS的就直接在省的selectindexchanged里面写市的联动加载就成了啊省在加载的时候就填充省就可以了。 http://topic.csdn.net/u/20090328/10/909d4d38-9ed9-49eb-81c2-9e74ddfe7bdf.html [控件]ChinaRegions v1.2 中国行政地区二级联动,XML数据驱动,AJAX,服务器控件 这到,居然是CS,那怎么到BS版来发帖。同样可以参考11楼的。另,本帖转C#版。 这里有封装好的控件,n级联动。http://topic.csdn.net/u/20110225/16/1aae774d-e92e-4d1f-9065-61b712063c28.html?44405 devexpress xtrareport 动态绑定数据 Winform项目设计问题?求助。 请教一个c#问题,帮帮忙,谢谢! C#开发WINFORM 现在用的人多吗 C#通过名称获得 按钮控件 关于关闭窗体问题 很高兴,找到工资合理的工作了,散分,顺便问个方案 C#读取 image类型 有谁用过DataGridView控件? 谁开发过类似阿里爸巴巴“贸易通”的客户端程序 不知道这个问题该怎么写 二级联动
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
c/s更容易了,直接调用selectindexchanged事件就好了。
CS的就直接在省的selectindexchanged里面写市的联动加载就成了啊
省在加载的时候就填充省就可以了。
[控件]ChinaRegions v1.2 中国行政地区二级联动,XML数据驱动,AJAX,服务器控件
同样可以参考11楼的。另,本帖转C#版。
http://topic.csdn.net/u/20110225/16/1aae774d-e92e-4d1f-9065-61b712063c28.html?44405