public ActionResult ListByLastNamePaged(string lastName, int startRow, int numberOfRows) { int numberOfAuthors = 0; List <Author> authors = _pubsService.ListAuthorsByLastNamePaged(lastName, startRow, numberOfRows, out numberOfAuthors); if (startRow > 1) { ViewBag.PreviousClass = "previous"; ViewBag.PreviousRow = startRow - numberOfRows; } else { ViewBag.PreviousClass = "previous disabled"; ViewBag.PreviousRow = startRow; } if (startRow + numberOfRows > numberOfAuthors) { ViewBag.NextClass = "next disabled"; ViewBag.NextRow = numberOfAuthors; } else { ViewBag.NextClass = "next"; ViewBag.NextRow = startRow + numberOfRows; } ViewBag.TotalRows = numberOfAuthors; return(PartialView("_AuthorList", authors)); }