// GET: Novel public ActionResult Show(int pageNumber, string categoryname) { List<GetBooksofPage_Result> Books = null; using (BookstoreEntities dbContext = new BookstoreEntities()) { int bookPerPage = 10; Books = dbContext.GetBooksofPage(bookPerPage, pageNumber, categoryname).ToList(); ViewBag.MaxPageNumber = dbContext.Books.Where(b=>b.Category==categoryname).Count() / bookPerPage + 1; ViewBag.Categoryname = categoryname; } return View("ShowBook", Books); }