1 //写一个类
2 public class SplictPage
3 {
4 public static string bind(string content, string Id)
5 {
6 string thisnr = "";
7 string thispage = "";
8 string[] temp = content.Trim().Split(<a href="mailto:'{@cpbcw}');">'{$cpbcw$}');</a>
9 if (System.Web.HttpContext.Current.Request.QueryString["page"] == null)
10 {
11 thisnr = "<div>" + temp[0] + "</div>";
12 }
13 else
14 {
15 thisnr = "<div>" + temp[System.Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["page"]) - 1] + "</div>";
16 }
17 if (temp.Length > 1)
18 {
19 for (int i = 0; i <= temp.Length - 1; i++)
20 {
21 thispage += "<a href=?x_id=" + Id + "&page=" + (i + 1) + ">[" + (i + 1) + "]</a> ";
22 }
23 }
24 return thisnr + thispage;
25 }
26 }
27 ----------------------
28 //调用
29 this.txtcontent.Text = SplictPage.bind(mydr["x_nr"].ToString(), "3");