zoukankan      html  css  js  c++  java
  • Asp.Net实现长文章分页显示功能

    //写一个类
    public class SplictPage
    {
        public static string bind(string content, string Id)
        {
            string thisnr = "";
            string thispage = "";
            string[] temp = content.Trim().Split(<a href="mailto:'{@cpbcw}');">'{$cpbcw$}');</a>        if (System.Web.HttpContext.Current.Request.QueryString["page"] == null)
            {
             thisnr = "<div>" + temp[0] + "</div>";
            }
            else
            {
                thisnr = "<div>" + temp[System.Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["page"]) - 1] + "</div>";
            }
            if (temp.Length > 1)
            {
                for (int i = 0; i <= temp.Length - 1; i++)
                {
                    thispage += "<a href=?x_id=" + Id + "&page=" + (i + 1) + ">[" + (i + 1) + "]</a> ";
                }
            }
            return thisnr + thispage;
        }
    }
    ----------------------
    //调用
    this.txtcontent.Text = SplictPage.bind(mydr["x_nr"].ToString(), "3");

  • 相关阅读:
    treap模板
    Codeforces Round #446 (Div. 2)
    BZOJ 1001: [BeiJing2006]狼抓兔子 (最小割)
    NOIP2017总结
    Python 操作 Mysql 模块
    poj 3660 Cow Contest (传递闭包)
    poj 1964 Cow Cycling(dp)
    poj 3671 Dining Cows (Dp)
    cogs 线型网络(状压dp)
    codevs 2800 送外卖(状压dp)
  • 原文地址:https://www.cnblogs.com/chaoa/p/2386109.html
Copyright © 2011-2022 走看看