protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { int id = 0; if (string.IsNullOrEmpty(Request.QueryString["id"])) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } if (!int.TryParse(Request.QueryString["id"], out id)) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); ppInfo = pp.GetModel(id); if (ppInfo == null) { WriteBackScript("alert('指定版块分区不存在');window.location.href='Index.aspx';"); return; } dsPlates = pp.GetSubPlates(id, true); } }
protected void BindPlates() { DropDownListPlates.Items.Clear(); DropDownListPlates.Items.Add(new ListItem("ȫ��", "-1")); if (DropDownListSections.SelectedValue == "-1") // ȫ�� { return; } else { ExtendBLL.PostPlate pp = new ExtendBLL.PostPlate(); DataSet ds = pp.GetSubPlates(int.Parse(DropDownListSections.SelectedValue)); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { DropDownListPlates.Items.Add( new ListItem(ds.Tables[0].Rows[i]["Name"].ToString(), ds.Tables[0].Rows[i]["ID"].ToString()) ); } } }