///<summary>///Bind all Picture lists///</summary>///<param name=A></param>///<param name="AspNetPager1"></param>///<param name="Filter"></param>ProtectedvoidBindlistpicpager (RepeaterAAspnetpagerAspNetPager1,expression<func<Bool>>Filter) {using (VarContext =NewJgdjentities ()) {VarNew_list =Newlist<Jy_newss> ();try {Get all the pictures that have been approved by the newsNew_list =Context.Jy_newss.Where (t =T.Jy_newsclass.Any (NC =nc.Ispass = = 1) &&T.Newsproperty! =NULL).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 (AAspNetPager1,null); }; a.datasource = new_list; a.databind (); } catch { } } }
My encapsulation of aspnetpager and repeater and the query criteria