public void BindPages() { try { user_dll = new UsersDLL(); DataTable dt = user_dll.GetSystemPages(); ddlPages.DataSource = dt; ddlPages.DataTextField = "PageName"; ddlPages.DataValueField = "PageID"; ddlPages.DataBind(); ddlPages.Items.Insert(0, new ListItem("--Select--", "0")); } catch (Exception ex) { ErrorMessage("System pages dropdown binding error:2 " + ex.Message); } }
public void BindGrid() { try { user_dll = new UsersDLL(); DataTable dt = user_dll.GetSystemPages(); if (dt.Rows.Count > 0) { ViewState["SystemPages"] = dt; grvPages.DataSource = dt; grvPages.DataBind(); } else { ShowEmptyGrid(); } } catch (Exception ex) { ErrorMessage("Grid binding error:1 " + ex.Message); } }