asp.net - Paging in ListView with Entity Framework -


I am paging with Entity Framework in Listview and when next / After clicking the next button, startindex and maxrows

this is my code

  private list & lt; WorkItem & gt; Data (int startindex, intexpressed) {return (x to s. Worksite image xx). OrderBe (P => P. VertimID). Skip (startx). Take (Exprod). Toolist (); } Secure void lvWorkItems_PagePropertiesChanging (Object Sender, PagePropertiesChangingEventArgs e) {this.DataPager1.SetPageProperties (e.StartRowIndex, e.MaximumRows, Incorrect); LvWorkItems.DataSource = Data (e.StartRowIndex, e.MaximumRows); LvWorkItems.DataBind (); }   

My problem is that when I click on the Next / Previous button then how to pass startindex and maxrows Please help out

Please check it out, extension method:

 < Code> Public Stable IQueryable & lt; T & gt; MyPage & lt; T, TResult & gt; (This IQueryable & lt; T & gt; obj, int page, int pagex, system.link.expressions & lt; t, t, trsalt & gt; key selector, bold acc, out int lines) line {line = Object Calculation (); If (ACC) {obj.OrderBy (key selector). Return (Page * Page Seas). Move (page size); } And {back to obj.OrderByDescending (key selector). Skip (Pages * Pages). Move (page size); }}    

Comments