[C#] 纯文本查看 复制代码 /// <summary>
/// 二级联动程序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
this.DropDownList5.Items.Clear();
DataBindTimeChange();
DataBindChannelChange();
}
/// <summary>
/// 时间联动
/// </summary>
protected void DataBindTimeChange()
{
ArrayList TimeList = new ArrayList();
ArrayList TimeList1 = new ArrayList();
TimeList.Add("00:00-01:00");
TimeList.Add("01:00-02:00");
TimeList.Add("02:00-03:00");
TimeList.Add("03:00-04:00");
TimeList.Add("04:00-05:00");
TimeList.Add("05:00-06:00");
TimeList.Add("06:00-07:00");
TimeList.Add("07:00-08:00");
TimeList.Add("08:00-09:00");
TimeList.Add("09:00-10:00");
TimeList.Add("10:00-11:00");
TimeList.Add("11:00-12:00");
TimeList.Add("12:00-13:00");
TimeList.Add("13:00-14:00");
TimeList.Add("14:00-15:00");
TimeList.Add("15:00-16:00");
TimeList.Add("16:00-17:00");
TimeList.Add("17:00-18:00");
TimeList.Add("18:00-19:00");
TimeList.Add("19:00-20:00");
TimeList.Add("20:00-21:00");
TimeList.Add("21:00-22:00");
TimeList.Add("22:00-23:00");
TimeList.Add("23:00-00:00");
TimeList1.Add("一天24小时");
switch (DropDownList2.SelectedItem.Text.ToString())
{
case "市场占有率":
DropDownList5.DataSource =TimeList;
DropDownList5.DataBind();
break;
default:
DropDownList5.DataSource = TimeList1;
DropDownList5.DataBind();
break;
}
}
给你参考一下 |