protected void LoadData() { using (dbFAQDataContext db = dbFAQDataContext.GetDataContext()) { var lst = (from c in db.tblFAQs where c.SiteID == SiteID orderby c.SortOrder select c).ToList(); dgMenu.DataSource = lst; dgMenu.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { using (dbFAQDataContext db = dbFAQDataContext.GetDataContext()) { var lstFAQ = (from f in db.tblFAQs where f.SiteID == SiteID && f.IsActive == true orderby f.SortOrder select f).ToList(); if (lstFAQ == null) { dgFAQ.Visible = false; } else { dgFAQ.DataSource = lstFAQ; dgFAQ.DataBind(); dgFAQ.Visible = true; } } }