November Happy Hour will be moved to Thursday December 5th.

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

Vote:
 

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
Vote:
 

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
Vote:
 

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

#65093
Jan 20, 2013 23:49
Vote:
 

That's because there isn't :)

#65095
Jan 21, 2013 9:20
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.