In this blog we will know how to do Paging with Image buttons inside a GridView.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView id="g1" Runat="Server" DataKeyNames="EmpId"
AllowPaging="True"
PageSize="2"
AllowSorting="True"
AutoGenerateColumns="False"
CellPadding="2"
HeaderStyle-BackColor="#E0E0E0"
PagerSettings-Position="TopAndBottom"
PagerSettings-Mode="NextPreviousFirstLast"
PagerSettings-FirstPageImageUrl="~/First.gif"
PagerSettings-PreviousPageImageUrl="~/Previous.gif"
PagerSettings-NextPageImageUrl="~/Next.gif"
PagerSettings-LastPageImageUrl="~/Last.gif"
PagerStyle-BackColor="#E0E0E0"
PagerStyle-HorizontalAlign="Center" onpageindexchanging="g1_PageIndexChanging">
<Columns>
<asp:BoundField DataField="EmpId" HeaderText="EmpId" ItemStyle-Width="50"/>
<asp:BoundField DataField="Title" HeaderText="Title" ItemStyle-Width="50"/>

Join the conversation! Your thoughts help the community grow.