protected void Page_Load(object sender, EventArgs e) { try { this.itemId = int.Parse(Request["id"].ToString()); } catch { } Context.Items["strTitle"] = "QUẢN LÝ MENU"; if (!Page.IsPostBack) { if (itemId != 0) { objData = objMenu.getData(itemId); if (objData == null) { Response.Redirect("Menu.aspx"); } } ddlGroup.DataSource = objMenu.getDataToCombobox("-- Thư mục gốc --"); ddlGroup.DataValueField = "ID"; ddlGroup.DataTextField = "NAME"; ddlGroup.DataBind(); ddlGroup.SelectedValue = itemId.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { try { this.group = int.Parse(Request["pid"].ToString()); } catch { } if (!Page.IsPostBack) { ddlGroup.DataSource = objMenu.getDataToCombobox("-- Thư mục gốc --"); ddlGroup.DataValueField = "ID"; ddlGroup.DataTextField = "NAME"; ddlGroup.DataBind(); ddlGroup.SelectedValue = group.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { try { this.itemId = int.Parse(Request["id"].ToString()); } catch { } if (!Page.IsPostBack && this.itemId != 0) { DataRow objData = objMenu.getData(this.itemId); if (objData == null) { objSystemClass.addMessage("Bạn cần chọn menu để sửa."); Response.Redirect("Menu.aspx"); return; } txtName.Text = objData["NAME"].ToString(); txtDescribe.Text = objData["DESCRIBE"].ToString(); txtLink.Text = objData["LINK"].ToString(); ddlGroup.DataSource = objMenu.getDataToCombobox("-- Thư mục gốc --"); ddlGroup.DataValueField = "ID"; ddlGroup.DataTextField = "NAME"; ddlGroup.DataBind(); if (objData["PID"].ToString() != null && objData["PID"].ToString() != "") { ddlGroup.SelectedValue = objData["PID"].ToString(); } else { ddlGroup.SelectedValue = "0"; } } }