protected void Page_Load(object sender, EventArgs e) { try { catID = "URL"; if (Settings["Nguon"] != null) catID = Settings["Nguon"].ToString(); if (catID == "URL") catID = Request.QueryString["categoryid"].ToString(); zClass ob = new zClass(); string catName = "-"; //DataTable dt = ob.zGetNewsCat(catID, out catName); DataTable dt = ob.ASP_nsLIST(catID, out catName); lbCatName.Text = catName; page = 10; if (Settings["Trang"] != null) page = Convert.ToInt32(Settings["Trang"].ToString()); GridView1.PageSize = page; GridView1.DataSource = dt; GridView1.DataBind(); if (UserInfo.IsInRole("DangTin") || UserInfo.IsInRole("DuyetTin")) { hlAddNews.Visible = true; hlAddNews.NavigateUrl = DotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "nsQLTT", "mid/" + this.ModuleId.ToString()); hlYahoo.Visible = true; } else { hlAddNews.Visible = false; hlYahoo.Visible = false; } } catch { } }
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; zClass ob = new zClass(); string catName = ""; //DataTable dt = ob.zGetNewsCat(catID, out catName); DataTable dt = ob.ASP_nsLIST(catID, out catName); GridView1.PageSize = page; GridView1.DataSource = dt; GridView1.DataBind(); }