// GET: Link public ActionResult Index(int page = 1) { int pagesize = 5; if (Session["username"] == null) { Response.Redirect("/Admin/Login"); } var result = LinkBLL.Index(); return(View(result.ToPagedList <link>(page, pagesize))); }