protected void ddlSecond_SelectedIndexChanged(object sender, EventArgs e) { var secondData = smSvc.GetSystemMenusByParentId(Guid.Parse(this.ddlSecond.SelectedValue)); this.ddlThird.DataSource = secondData; this.ddlThird.DataTextField = "SystemMenus_Title"; this.ddlThird.DataValueField = "SystemMenus_Id"; this.ddlThird.DataBind(); }
public void Bind() { Guid id = Request.Params["action"] == null ? Guid.Empty : Guid.Parse(Request.Params["action"]); if (id == Guid.Empty) { Response.Write("<script>alert('数据丢失,请重试';location.href='SystemMenus_List.aspx'</script>"); } var data = smSvc.GetSystemMenus(id); this.HiddenField1.Value = data.SystemMenus_Id.ToString(); this.txtName.Text = data.SystemMenus_Title; this.txtLink.Text = data.SystemMenus_Link; this.txtIcon.Text = data.SystemMenus_Icon; if (data.SystemMenus_ParentId != Guid.Empty) { var parentData = smSvc.GetSystemMenus(data.SystemMenus_ParentId); if (parentData.SystemMenus_ParentId == Guid.Empty) { this.ddlFirst.SelectedValue = "2"; this.ddlSecond.Style.Add("display", "block"); var parentdatas = smSvc.GetSystemMenusByParentId(Guid.Empty); this.ddlSecond.DataSource = parentdatas; this.ddlSecond.DataTextField = "SystemMenus_Title"; this.ddlSecond.DataValueField = "SystemMenus_Id"; this.ddlSecond.DataBind(); this.ddlSecond.SelectedValue = parentData.SystemMenus_Id.ToString(); } else { this.ddlFirst.SelectedValue = "3"; } } }