using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using FilmsRUsOnline.Models; namespace FilmsRUsOnline.HtmlHelpers { public static class PaginationHelpers { public static MvcHtmlString PaginationLinks(this HtmlHelper html, PaginationInfo pinfo, Func url) { String result = ""; for (int p = 1; p <= pinfo.NumPages; p++) { if (p == pinfo.CurrPage) result += "" + p + " "; else result += string.Format("{1} ", url(p), p); } return MvcHtmlString.Create(result); } } }