protected void Page_Load(object sender, EventArgs e) { int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); int pageSize = int.Parse(Request["pageSize"] ?? "15"); int total = 0; ListPage = GetListPage(pageIndex, pageSize, out total); NavHtml = CjsPager.ShowPageNavigate(pageSize, pageIndex, total); }
//获得专题中的新闻列表 private String GenerateContent(int category) { StringBuilder sb = new StringBuilder(); List <T_Article> list = new List <T_Article>(); int pageIndex = int.Parse(Request["pageIndex"] ?? "1"); int pageSize = int.Parse(Request["pageSize"] ?? "15"); int total = 0; ArticleBLL bll = new ArticleBLL(); list = bll.GetListByCategory(pageIndex, pageSize, category, out total); //形成列表 if (list.Count > 0) { foreach (T_Article model in list) { sb.AppendFormat("<li><a href='articleDetail.aspx?articleid={0}' target='_blank'>{1}</a><span>{2}</span></li>", model.ArticleId, model.ArticleTitle, model.ArticleTime); } this.NavStrHtml.Text = CjsPager.ShowPageNavigate(pageSize, pageIndex, total); } return(sb.ToString()); }