Close access to ASP. Net (13)

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.