Click here to Skip to main content
15,867,330 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I work on asp.net web forms . I face issue I can't display previous and next button with Numeric page number .

current status display page number numeric mode only as 1,2,3,4 etc.

but I can't display previous and next with page numbers

so How to make that ?

previous button will get previous page of current

Next Button will get next page of current .

my expected result add previous and next button for pagination with page number numeric
add previous and next.png is available for download[^]

What I have tried:

<asp:GridView ID="GridViewSearchData" runat="server" AutoGenerateColumns="false" DataKeyNames="ID" CssClass="table"  HeaderStyle-BackColor="#172b4d" HeaderStyle-CssClass="header"   AllowPaging="true" OnPageIndexChanging="grdData_PageIndexChanging" PageSize="5" OnDataBound="OnDataBound">                                                                                                                    
    <Columns> 
    <asp:BoundField DataField="BranchCode" HeaderText="BranchCode" HeaderStyle-ForeColor="White" />
    <asp:BoundField DataField="Status"  HeaderText="Status" HeaderStyle-ForeColor="White"  />
    <asp:BoundField DataField="OrderNo" HeaderText="OrderNo" ItemStyle-Width="120px" HeaderStyle-ForeColor="White"  />
    <asp:BoundField DataField="OrderType" HeaderText="OrderType" HeaderStyle-ForeColor="White"  />
    <asp:BoundField DataField="Printer_name" HeaderText="Printer_name" HeaderStyle-ForeColor="White"  />
    <asp:BoundField DataField="EntredDatetime" HeaderText="EntredDatetime" HeaderStyle-ForeColor="White"  />                            
    </Columns>
</asp:GridView>

protected void Search_Click(object sender, EventArgs e)
        {
             DataTable dt;

            dt = busiObj.DisplayAllSearchData(dropBranches.SelectedItem.Value/*, datelogged, dropOrderType.SelectedItem.Value, eventDatefromtime, eventDatetotime*/);
            if (dt.Rows.Count > 0)
            {
               
                GridViewSearchData.DataSource = dt;
                GridViewSearchData.DataBind();
                GridViewSearchData.HeaderRow.Height = 10;
                

            }
            
        }
Posted

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