C#分頁控制項(自己做的)

來源:互聯網
上載者:User
目前支援2.0或以上版本,
http://files.cnblogs.com/cuihongyu3503319/我的分頁1.1.rar
http://files.cnblogs.com/cuihongyu3503319/我的分頁源碼.rar
前台
<cc1:SetPage ID="SetPage1" runat="server" OnMyPageChanged="SetPage1_MyPageChanged" />
後台
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindGridview();
        }
    }
    protected void BindGridview()
    {
        DataTable dt = new DataTable();
        //目前只支援DataTable 
        SetPage1.Dtsource = dt;
        GridView1.DataSource = SetPage1.Pdsource;
        GridView1.DataBind();
    }
    protected void SetPage1_MyPageChanged(object sender, EventArgs e)
    {
        BindGridview();
    }
其中控制項暫時有4個開放屬性
MyHigh 高
MyWidth寬
MyBlackColor背景色
MyStyle樣式

 

源碼上傳了 寫的有點亂 請大家見諒
以前不傳是覺得寫的不好 不好意思傳 大家一起學習吧 不在乎了
這個分頁控制項不是預存程序分頁,效率一般,但是用起來比較方便,適合中小資料量應用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.