使用C#在ASP.NET中分页链接 [英] Paging Links in ASP.NET With C#

查看:62
本文介绍了使用C#在ASP.NET中分页链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,亲爱的朋友,

我正在使用Sql Server存储过程创建自定义分页.现在,我已经成功创建了Everytihng,但是现在我正在数据下方创建页面链接,并使用以下代码成功创建了:-

Hello Dear Friends,

I am creating custom Paging with Sql Server Stored Procedure. And now I am successfully created everytihng but now i am creating page links below the data and successfully create with this code: -

for (int i = 1; i <= Pages; i++)
        {

            LinkButton lnkButton = new LinkButton();
            lnkButton.Text = i.ToString();
           // lnkButton.BorderWidth = Unit.Pixel(1);
            //lnkButton.BackColor = System.Drawing.Color.SkyBlue;
            lnkButton.Width = Unit.Pixel(20);
            lnkButton.PostBackUrl = "~/jobs.aspx?";

            if (lnkButton.Text == currentPageNumber.ToString())
            {
                lnkButton.Enabled = false;
            }
            Paging.Controls.Add(lnkButton);

        }


现在,我希望每当有人单击linkbutton时pageindex更改,并且据此更改的数据,如果我为此创建了一个Event但无法在运行时调用该事件,则可以实现.请告诉我,如何在运行时调用事件以增加或减少pageindex.我的活动是:-


Now I want that whenever someone clicks on linkbutton the pageindex changes and data according to that will be changed it can be possible if I create a Event for this but not able to call that event at runtime. Please tell me that how can i call an event at runtime to increase or decrease pageindex. My Event is :-

private void lnkButton_Click(object sender, EventArgs e)
    {

    }


还要告诉我什么代码最适合于此.如果你们有其他有效的方法来创建分页,请与我分享.

在此先感谢.


Also tell me what code should be best suited in this . If you guys have alternate method to create paging with efficient way please share it with me.

Thanks in Advance.

推荐答案

您尝试使用datapager控件(asp.net 3.5)吗?这是链接.
Did you try using datapager control (of asp.net 3.5). Here is the link.


希望
Hope this[^] might help you.


这篇关于使用C#在ASP.NET中分页链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆