Summary of pagination auxiliary classes under webform

Source: Internet
Author: User

1. engineering and project structure

In the DAL layer, we mainly control and implement data access through IBatisNet. If you are not clear about IBatisNet, you can imagine that IBatisNet is used to return a generic data list set based on the query conditions.

 

2. Page-based parameter passing for paging Query

In the sample code in this article, you can enter FirstName and (or) LastName to fuzzy match and query some people, and display them on a page through a GridView. The process of passing parameters is very important. after entering the parameters in the two TextBox fields, in the program, we need to analyze whether to click a button or directly click a number for paging query, therefore, the following Page Load data initialization process is very important:

01 protected int currentPg = 1; 02    protected int totalCount = 0; 03    protected int recordsPerPg = 10; 04    private int leftSize = 3; 05    private IList<Person> listPerson = null ; 06    protected void Page_Load( object sender, EventArgs e) 07    { 08        if (IsPostBack == false && string .Compare(Request.RequestType.ToLower(), "get" ) == 0) 09        { 10            if ( string .IsNullOrEmpty(Request[ "pageIndex" ]) == false && RegUtil.IsPositiveNumber(Request[ "pageIndex" ])) 11            { 12                currentPg = int .Parse(Request[ "pageIndex" ]); 13            } 14            if ( string .IsNullOrEmpty(Request[ "firstname" ]) == false ) 15            { 16                this .txtFirstName.Text = Request[ <

Related Article

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.