Encapsulate the common method of WebForm: For software I enclose these in pagebase, so that all the pages are only called One Init (), and the others are all configured on the page

Source: Internet
Author: User

///<summary>///Binding a news list with pagination and query///</summary>///<param name=A></param>///<param name="AspNetPager1"></param>///<param name="Filter"></param>ProtectedvoidBindlist (RepeaterAAspnetpagerAspNetPager1,expression<func<Bool>>Filter) {Classno =request["Classno"];VarNew_list =Newlist<Jy_newss> ();try {New_list =Common.Getnewslistbycno (CLASSNO).OrderByDescending (U =U.Createtime).ToList ();AspNetPager1.RecordCount =New_list.Count ();if (AspNetPager1.Startrecordindex = = 1) {New_list =New_list.Take (15).ToList (); }else {New_list =New_list.Skip (AspNetPager1.STARTRECORDINDEX-1).Take (15).ToList (); }AspNetPager1.Pagechanged + = (CD) = = {bindlist (a,  Aspnetpager1, null);                 };                 a.new_list;                 a.databind ();             }  catch { }        }       

The

Encapsulates the common method of WebForm: For software I enclose these in pagebase, so that all the pages are called only one Init (), and the others are all configured on the 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.