日期:2014-05-18 浏览次数:20438 次
protected void PageNews(string news) { string[] a = new string[] { "<div style='page-break-after: always'><span style='display: none'>page break</span></div>" }; string[] temp = news.Split(a, StringSplitOptions.RemoveEmptyEntries); //string[] temp = news.Split('^'); int currentPage = 1; if (temp.Length <= 1) { this.lblContent.Text = news.ToString(); } else { for (int i = 0; i < temp.Length; i++) { if (i == currentPage) { this.lblPageNumber.Text = "第" + i + "页 | "; } else { lblPageNumber.Text += "[<a href=LookArticle.aspx?id=" + HttpContext.Current.Request["id"].ToString() + "&page=" + i + ">" + (i + 1) + "</a>] "; currentPage = i; } lblContent.Text = temp[currentPage].ToString(); } //pageNum.Text += pageInfo; } }