private void LoadCategories() { try { var blCategories = new BLCategories(); var dtCategories = blCategories.LoadCategories(1, "DEMO"); if (dtCategories != null) { drpcategoryID.DataSource = dtCategories; drpcategoryID.DataBind(); drpcategoryID.DataTextField = "CategoryName"; drpcategoryID.DataValueField = "Id"; drpcategoryID.DataBind(); } } catch (Exception ex) { throw; } }
private void BindCategoriesGrid() { try { var blCategories = new BLCategories(); var dtCategories = blCategories.LoadCategories(1, "DEMO"); if (dtCategories != null) { gvCategory.Visible = true; gvCategory.DataSource = dtCategories; gvCategory.DataBind(); ViewState["Categories"] = dtCategories; } else { gvCategory.Visible = false; } } catch (Exception ex) { throw; } }