Personalized paging implementation
The paging we mentioned earlier only implements paging by modifying the properties of the DataGrid, which has the following benefits:
The biggest difference is that it is simple. You don't have to worry about how paging is generated.
However, it also has shortcomings and cannot generate various styles we need as we imagined.
There is no way. If you want to personalize the function, you have to do it yourself.
Step by step, the first step is to import the required namespace. In the following example, I actually got it from abroad.
In addition, I want to add some personal stuff to the Chinese language. I am in a good mood today. I even show you the color of tags.
Yes. Haha, it is more conducive to watching the program.
<% @ Page Language = "C #" %>
<% @ Import Namespace = "System. Data" %>
<% @ Import Namespace = "System. Data. SQL" %>
Let's first look at what our web controls are, and then look at how the code is written, which is better :)
<Body>
<H3> <font face = "Verdana"> personalized paging instance ^ & ^ </font> <Form runat = server>
<ASP: DataGrid id = "MyDataGrid" runat = "server"
AllowPaging = "True"
PageSize = "10"
PagerStyle-Mode = "NumericPages"
PagerStyle-HorizontalAlign = "Right"
OnPageIndexChanged = "MyDataGrid_Page"
BorderColor = "black"
BorderWidth = "1"
GridLines = "Both"
CellPadding = "3"
CellSpacing = "0"
Font-Name = "Verdana"
Font-Size = "8pt"
HeaderStyle-BackColor = "# aaaadd"
AlternatingItemStyle-BackColor = "# eeeeee"
AutoGenerateColumns = "false"
>
<Property name = "Columns">
<Asp: BoundColumn HeaderText = "Studio member" DataField = "Enter_ID"/>
<Asp: BoundColumn HeaderText = "Logon Time" DataField = "Enter_Time"/>
</Property>
</ASP: DataGrid>
<P>
<Asp: LinkButton id = "btnFirst" runat = "server"