
asp.net里面dropdownlist的数据绑定功能(使用泛型集合)
asp.net里面如何选择一个dropdownlist1的值而让另一个dropdownlist2里的值随之改变,就像一些网站上选择省份,而城市也随之改变的功能。...
asp.net里面如何选择一个dropdownlist1的值而让另一个dropdownlist2里的值随之改变,就像一些网站上选择省份,而城市也随之改变的功能。
展开
展开全部
protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
{
binding2();
}
private void binding1()
{
DataSet ds3 = dbconn.getBinding("select addressid, addressname from AddressMessage where BelongCustomer='0000'", "a");
DropDownList6.DataSource = ds3;
DropDownList6.DataTextField = "addressname";
DropDownList6.DataValueField = "addressname";
DropDownList6.DataBind();
}
private void binding2()
{
DataSet ds1 = dbconn.getBinding("select addressid,addressname from AddressMessage where addressname='" + DropDownList6.SelectedValue + "' ", "aa");
DropDownList7.DataSource = ds1;
DropDownList7.DataTextField = "addressname";
DropDownList7.DataValueField = "addressname";
DropDownList7.DataBind();
}
{
binding2();
}
private void binding1()
{
DataSet ds3 = dbconn.getBinding("select addressid, addressname from AddressMessage where BelongCustomer='0000'", "a");
DropDownList6.DataSource = ds3;
DropDownList6.DataTextField = "addressname";
DropDownList6.DataValueField = "addressname";
DropDownList6.DataBind();
}
private void binding2()
{
DataSet ds1 = dbconn.getBinding("select addressid,addressname from AddressMessage where addressname='" + DropDownList6.SelectedValue + "' ", "aa");
DropDownList7.DataSource = ds1;
DropDownList7.DataTextField = "addressname";
DropDownList7.DataValueField = "addressname";
DropDownList7.DataBind();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询