public ActionResult ComplainListAccepted(int id = 0) { if (Session["Identity"] == null) { return RedirectToAction("login"); } DataClasses1DataContext s = new DataClasses1DataContext(); int? sz = s.getAcceptedComplaintPageCount(6); IQueryable<getAcceptedComplaintByPageResult> fs = s.getAcceptedComplaintByPage(id + 1, 6); ViewData.Model = fs; ViewData["pageCount"] = id; ViewData["maxPage"] = sz; return View(); }