public ActionResult Manage(int?page, int?items, string sortOrder, string currentFilter) { ViewData["IdSortParm"] = String.IsNullOrEmpty(sortOrder) ? "id_desc" : ""; ViewData["UserSortParm"] = sortOrder == "user" ? "user_desc" : "user"; ViewData["AddDateSortParm"] = sortOrder == "adddate" ? "adddate_desc" : "adddate"; ViewData["LoginDateSortParm"] = sortOrder == "logindate" ? "logindate_desc" : "logindate"; var moderators = _moderatorService.FilterSearch(currentFilter); moderators = _moderatorService.SortList(sortOrder, moderators); var result = PaginatedList <Moderator> .Create(moderators.AsNoTracking(), page, items); result.Pagination.Configure("manage", currentFilter, sortOrder); return(View(result)); }