'WebGrid Asp.Net MVC Custom Pager
I'm try to extend my webgrid pager but when I try to call the method to page the system return me the follow error:
System.Web.Helpers.WebGrid does not contain a definition for PagerList and no extension method PagerList accepting a first argument of type System.Web.Helpers.WebGrid could be found (are you missing a using directive or an assembly reference?)
Look for my class constructor:
public static HelperResult PagerList(
this WebGrid webGrid,
WebGridPagerModes mode = WebGridPagerModes.NextPrevious | WebGridPagerModes.Numeric,
string firstText = null,
string previousText = null,
string nextText = null,
string lastText = null,
int numericLinksCount = 5)
{
return PagerList(webGrid, mode, firstText, previousText, nextText, lastText, numericLinksCount, explicitlyCalled: true);
}
Look for my Webgrid declaration and my extended class
var grdConvidados = new WebGrid(null, rowsPerPage: 10, ajaxUpdateContainerId: "deploymentsGrid", canSort: false, canPage:true);
@grid.PagerList(mode: WebGridPagerModes.All)
Solution 1:[1]
Article describes the Efficient Paging with WebGrid Web Helper - ASP.NET MVC
http://www.dotnetcurry.com/ShowArticle.aspx?ID=618
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
