技巧1:在分頁區中改變當前頁碼的樣式或高亮顯示頁碼
一個簡單的辦法,就是爲分頁區配置如下的CSS樣式
<head runat="server">
<title></title>
<style type="text/css">
.cssPager span { background-color:#4f6b72; font-size:18px;}
</style>
</head>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" AutoGenerateColumns="false" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
<PagerStyle CssClass="cssPager" /
技巧2:增加分頁區中頁碼之間的間隔
與技巧1一樣,可以設置如下的CSS樣式。但要注意,該樣式旨在在修改分頁區中的TD元素。因爲頁碼是放置於TD元素之中。
<head runat="server">
<title></title>
<style type="text/css">
.cssPager td
{
padding-left: 4px;
padding-right: 4px;
}
</style>
</head>
<asp:GridView ID="GridView1" runat="server" AllowPaging="true" AutoGenerateColumns="false" DataKeyNames="ProductID" DataSourceID="SqlDataSource1">
<PagerStyle CssClass="cssPager" />