Click here to Skip to main content
15,921,203 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more: , +
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: -

C#
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);

        }

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 :-
C#
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.
Posted
Updated 7-Jun-11 20:48pm
v2

Did you try using datapager control (of asp.net 3.5). Here is the link.
 
Share this answer
 
Hope this[^] might help you.
 
Share this answer
 
Comments
Satyendra Kumar(Analyst Programmer) 8-Jun-11 4:06am    
I am using Custom Paging with stored procedure and dynamically use 3- tier architecture. So please if possible please tell me how can i use DataPazer with Ado.net.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900