What is the best way to implement paging with EPiServer using MVC?

 

Dear all,

I was wondering what is the best way to implement paging with EPiServer 7 using MVC?

Thank you in advance for your valuable help!

Daniel

#65089 Jan 19, 2013 21:01
  •  

    What's the data source? In your controller add an action method that takes a few parameters for start index, size etc, then you can use the LINQ extension methods Skip and Take to get back what you need from your data source.

     

    ActionResult Search(int startIndex, int pageSize) 
    { var result = datasource.Skip(startIndex).Take(pageSize);
    }

        

    Frederik

    #65091 Edited, Jan 20, 2013 14:09
  •  

    I can't see any difference compare to how you implement it in the standard MVC application. 

    #65093 Jan 20, 2013 23:49
  •  

    That's because there isn't :)

    #65095 Jan 21, 2013 9:20