Intimate contact asp.net (13)

Source: Internet
Author: User
Personalized Paging implementation
The pagination we talked about was just a way to implement pagination by modifying the properties of the DataGrid, which has the benefit
, the biggest is simple, hehe, do not have to worry about, pagination is how to produce.
But it is also flawed and does not produce the kinds of styles we want to do as we imagine.
There is no way to personalize the function, only to do it yourself, hehe.
The first step is to import the required namespaces. The following example, in fact, I also found from abroad
, plus some personal stuff, and then Chinese, hehe. The mood is very good today, I even the label color to show everybody
Here it comes. Oh, more conducive to everyone to see the program.
<%@ Page language= "C #"%>
<%@ Import namespace= "System.Data"%>
<%@ Import namespace= "System.Data.SQL"%>
Let's take a look at what our web controls are, and then look at how the code is written, which is better:
<body>
<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= "Landing 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.