ASP.NET MVC에서 페이지 매김을 수행하는 가장 선호되고 쉬운 방법은 무엇입니까? 즉, 목록을 여러 개의 검색 가능한 페이지로 나누는 가장 쉬운 방법은 무엇입니까?
예를 들어 다음과 같이 데이터베이스 / 게이트웨이 / 저장소에서 요소 목록을 가져 온다고 가정 해 보겠습니다.
public ActionResult ListMyItems()
{
List<Item> list = ItemDB.GetListOfItems();
ViewData["ItemList"] = list;
return View();
}
간단히하기 위해 내 작업에 대한 페이지 번호 만 매개 변수로 지정하고 싶습니다. 이렇게 :
public ActionResult ListMyItems(int page)
{
//...
}