next and prev button for a custom pager using PagedDataSource
<p>I am trying to get the next and prev button on my custom pager. Here is what I have so far and it's working perfect except it needs next and prev button.</p>

<p><strong>What I have done</strong></p>

<pre><code> PagedDataSource page = new PagedDataSource();

                page.AllowCustomPaging = true;
                page.AllowPaging = true;
                page.DataSource = query;
                page.PageSize = 5;
                QRep.DataSource = page;
                QRep.DataBind();
</code></pre>

<p>*Qrep is a asp.net repeater control and *query is a result of linq to sql query.</p>

<p><strong>here is how i create the pager controls and assigned event handlers</strong></p>

<pre><code>private void CreatePagingControl()
    {
        for (int i = 0; i &lt; (RowCount / 5) + 1; i++)
        {


            LinkButton lnk = new LinkButton();
            lnk.Click += new EventHandler(lbl_Click);
            lnk.ID = "lnkPage" + (i + 1).ToString();
            lnk.Text = (i + 1).ToString();
            plcPaging.Controls.Add(lnk);
            Label spacer = new Label();
            spacer.Text = "&amp;nbsp;";
            plcPaging.Controls.Add(spacer);

        }

    }

    void lbl_Click(object sender, EventArgs e)
    {
        LinkButton lnk = sender as LinkButton;
        int currentPage = int.Parse(lnk.Text);
        int take = currentPage * 5;
        int skip = currentPage == 1 ? 0 : take - 5;
        FetchData(take, skip);
    }    
</code></pre>

<p>the row count is stored as below</p>

<pre><code>private int RowCount
    {
        get
        {
            return (int)ViewState["RowCount"];
        }
        set
        {
            ViewState["RowCount"] = value;
        }
    }
</code></pre>

<p>This is working fine , except it only displays page numbers and I want to know how the next and prev controls can be integrated with this. Any help appreicated guys. Thanks in advance.</p>
