"Original" ASP. Webdiyer Aspnetpager Control when the page number is changed, the ordinal column is resolved from the beginning of the new 1

Source: Internet
Author: User

To take a long story short, first look at the Webdiyer Aspnetpager property setting code for repeater with Webdiyer Aspnetpager.

<webdiyer:aspnetpager id= "AspNetPager1" runat= "Server" cssclass= "Paginator" onpagechanging= "aspnetpager1_ Pagechanging "
        currentpagebuttonclass= "CPB" firstpagetext= "Home" lastpagetext= "last" nextpagetext= "Next"
        prevpagetext= "prev" showmorebuttons= "true" showcustominfosection= " Right "custominfotextalign=" right "
         layouttype= "Table" showpageindexbox= "Never" submitbuttontext= "Jump" pagesize= "" "
        custominfohtml= "Total%pagecount% page/page%currentpageindex%,%pagesize% bar per page, Total records:%recordcount% "
         urlpaging= "true" alwaysshow= "true",
     </webdiyer:aspnetpager>

As can be seen from the above code, this paging is the value of the URL to pass. When using <% #Container .itemindex+1%> to generate the sequence number, the second page sequence number still starts from 1, ideally, it should start at 3.

The sequence number can be generated like this,

public string Returnorder (int xmid)
{
int page = 0;
if (request.querystring["page"]! = NULL)
{
page = Int. Parse (request.querystring["page"])-1;
}

int STRXM = page * aspnetpager1.pagesize + xmid;
return strxm.tostring ();
}

Front binding code:

<TD style= "white-space:nowrap" align= "Center" >
<%# Returnxm (container.itemindex+1)%>
</td>

Effect:

"Original" ASP. Webdiyer Aspnetpager Control when the page number is changed, the ordinal column is resolved from the beginning of the new 1

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.