Mam taka extension method:
public static MvcHtmlString PageLinks(this HtmlHelper html, PagingInfo pagingInfo, Func<int, string> pageUrl)
{
StringBuilder result = new StringBuilder();
for (int i = 1; i <= pagingInfo.TotalPages; i++)
{
TagBuilder tag = new TagBuilder("a");
tag.MergeAttribute("href", pageUrl(i));
tag.InnerHtml = i.ToString();
if (i == pagingInfo.CurrentPage)
tag.AddCssClass("selected");
result.Append(tag.ToString());
}
return MvcHtmlString.Create(result.ToString());
}
teraz podobno ma byc widoczna w widoku ale niestety nie widac jej po kropie,dokladnie tutaj:
@Html.Tutaj!!!(Model.PagingInfo, x => Url.Action("List", new { page = x }))
W web.configu tez dodalem folder w ktorym znajduje sie ta klasa z metoda extension i nic,co jest nie tak,po odpaleniu mam komunikat "does not contain a definition for 'PageLinks' and no extension method 'PageLinks' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<SportsStore.WebUI.Models.ProductsListViewModel>' could be found (are you missing a using directive or an assembly reference?)"