public static MvcHtmlString SortHeader(this HtmlHelper html, PagedViewModel data, string text, string prop, string action) { bool desc = data.SortDesc; if (data.SortBy.Equals(prop, StringComparison.OrdinalIgnoreCase)) desc = !desc; return html.ActionLink(text, action, new { page=1, sort=prop, desc }); }
public static MvcHtmlString Pager(this HtmlHelper html, PagedViewModel data, string action) { data.Action = action; return html.Partial("Pager", data); }