protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //NewsClass = Request.QueryString["classname"].ToString(); DataTable zt = NewsBll.zatan(); NewsLD.DataSource = zt; NewsLD.DataBind(); if (zt != null) { News_ClassName2.Text = zt.Rows[0][6].ToString(); } } }
protected void Button1_Click(object sender, EventArgs e) { if (DropDownList_Class.SelectedIndex == 0) { ListView1.DataSource = NewsBll.luandou(); ListView1.DataBind(); } else if (DropDownList_Class.SelectedIndex == 1) { ListView1.DataSource = NewsBll.zatan(); ListView1.DataBind(); } else if (DropDownList_Class.SelectedIndex == 2) { ListView1.DataSource = NewsBll.banben(); ListView1.DataBind(); } else { ListView1.DataSource = NewsBll.kazu(); ListView1.DataBind(); } }