Add Gridview
<asp:gridview id="DgTest" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
Width="100%" AllowSorting="True" OnRowCommand="DgTest_RowCommand"
OnRowDataBound="DgTest_RowDataBound" AllowPaging="True"
onpageindexchanging="DgTest_PageIndexChanging" CaptionAlign="Right">
<pagersettings firstpagetext="First" lastpagetext="Last">
Mode="NextPreviousFirstLast" NextPageText="Next" PreviousPageText="Previous" />
<columns>
<asp:boundfield datafield="ID" headertext="Id" />
<asp:boundfield datafield="NAME" headertext="Name of Emp" />
</columns>
</pagersettings></asp:gridview>
Create PageIndexChanging event as
protected void DgTest_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
DgTest.PageIndex = e.NewPageIndex;
Populate();
}
private void Populate()
{
}