• 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");

  • 相关阅读:
    VS自带的诊断工具
    Electron学习
    PC跨*台
    .NET调试学习
    Mac使用
    SSL/TLS
    UKey学习
    授权机制OAuth、JWT
    代理服务器
    .NET相关源码查找
  • 原文地址:https://www.cnblogs.com/chaoa/p/2386109.html
Copyright © 2020-2023  润新知