07asp.net==== Sub-page

Source: Internet
Author: User

public string strHTML {get; set;}
public int PageCount {get; set;}
public int PageIndex {get; set;}
public string Strpagebar {get; set;}
protected void Page_Load (object sender, EventArgs e)
{
USERINFOBLL BLL = new USERINFOBLL ();
int pageIndex;
int PageCount = BLL. Getpagecount (10);//Get Total pages
PageCount = pagecount;//to previous total pages
if (!int. TryParse (request.querystring["PageIndex"], out pageIndex)//Get page number, first time empty
{
The first time I loaded
PageIndex = 1;
}
Determine the value of a pageindex
PageIndex = PageIndex < 1? When 1:pageindex;//is less than 1
PageIndex = pageIndex > PageCount? When pagecount:pageindex;//is greater than the total number of pages
PageIndex = pageindex;//passed to the previous paragraph current page
Query the data to be displayed on the current page based on the page number passed in.
list<userinfomoldel> list = BLL. Getthispagelist (PageIndex, 10);//query user data by page number
StringBuilder sb = new StringBuilder ();
foreach (Userinfomoldel userinfo in list)
{
Sb. AppendFormat ("<li><span>{0}</span><a href= ' newlist.aspx ' target= ' _blank ' >{1}</a> </li> ", UserInfo. Regtime,userinfo. Username+ "===>" +userinfo. USERPWD);
}
strHTML = sb. ToString ();//concatenation of strings

Userinfocommon.pagebar PB = new Userinfocommon.pagebar ();//display of Digital page bar
strpagebar= PB. Getpagebar (PageIndex, PageCount);

}

07asp.net==== Sub-page

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.