级联菜单是这么实现的?省和市都是从数据库里读取的,选择省,就显示这个省包含的市,请各位告示指教,谢了...........
解决方案 »
- 三层架构中objectdatasource如何获取BLL层返回的值?
- 能否通过按钮动态的创建控件?不在Page_Load中创建?
- 在Menu控件中动态添加多个menuitem,方向为横向,请问如何实现menuitem的换行显示?
- 登陆怎么这样呢?
- 还是动态控件的问题
- 大学 实验室 管理系统 完整源码
- 急急,简章的错误,但是我查不出来。
- 一个AJAX for asp.net 的问题
- 今天是我的生日,却没人祝我生日快乐! 散分啦! 大家Happy!
- dataGrid數據更新問題!!
- |M| 幕白兄写给我的一段Table排序的js代码,后来我在这个Table前和后加多了各一行后进行排序,以为改成来很简单但我却怎么也改不到 谢谢
- C#倒计时功能
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
SqlConnection con = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
SqlDataAdapter da = new SqlDataAdapter("select state from user_item group by state", con); // DataSet ds = new DataSet("State");
// da.Fill(ds);
// this.DropDownList1.DataSource = ds.Tables[0];
// this.DropDownList1.DataTextField = "state";
// this.DropDownList1.DataValueField = "state";
// this.DropDownList1.DataBind();
// this.DropDownList1.Attributes.Add("onchange","load()");
/////////////// DataSet ds = new DataSet();
da.Fill(ds);
this.DropDownList1.DataSource = ds;
this.DropDownList1.DataTextField = "state";
this.DropDownList1.DataValueField = "state";
this.DropDownList1.DataBind();
this.DropDownList1.Items.Insert(0, "请选择");
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
//if (this.DropDownList1.SelectedValue != "0")
//{
SqlConnection scon = new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnectionString"]);
SqlDataAdapter da1 = new SqlDataAdapter("select address from user_item where state = '" + this.DropDownList1.SelectedValue + "' order by address", scon);
DataSet ds1 = new DataSet("address");
da1.Fill(ds1);
this.DropDownList2.DataSource = ds1;
this.DropDownList2.DataTextField = "address";
this.DropDownList2.DataValueField = "address";
this.DropDownList2.DataBind();
//}
}
完整的代码!