public ActionResult AcceptedComplaintSearchList(int id = 0) { if (Session["Identity"] == null) { return RedirectToAction("login"); } DataClasses1DataContext s = new DataClasses1DataContext(); int? count = s.getAcceptedComplaintBySearchContentPageCount(6, "%" + Request["query"] + "%"); IQueryable<getAcceptedComplaintBySearchContentByPageResult> fs = s.getAcceptedComplaintBySearchContentByPage(id + 1, 6, "%" + Request["query"] + "%"); ViewData.Model = fs; ViewData["pageCount"] = id; ViewData["maxPage"] = count; return View(); }