When I select any page of my PagedList<T>
the [HttpGet]
method is activated. Because of this, Im not able to use Request.Form.GetValues()
.
I just saw the Request
variable into the immediate window and realized that I dont see any value that I want from the IDs that I have ( the request dont bring me any value of any ID of the screen, since Im not using the post method).
I got a grid (table) and one field of each record is a checkbox, after the pagination, I need know wich checkbox is enabled to keep it checked ( I already made the code to keep it checked, I just need to know how Im going to see if those checkboxes are checked.
I already know their ID too.
Im using the following control to generate those checkboxes:
//foreachloop
<%: Html.CheckBox(item.ID.ToString(), item.isChecked)%>
For my pagination, Im using the following:
Aspx:
<%: Html.Pager(Model.ListaGridPaginada)%>
This pager is a overload that calls the following:
public static MvcHtmlString Pager(this HtmlHelper helper, int totalPageCount, int pageIndex, string actionName, string controllerName,
PagerOptions pagerOptions, string routeName, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
{
var builder = new PagerBuilder
(
helper,
actionName,
controllerName,
totalPageCount,
pageIndex,
pagerOptions,
routeName,
routeValues,
htmlAttributes
);
return builder.RenderPager();
}
I call the method wich constructs this variable with the following parameters:
public static MvcHtmlString Pager<T>(this HtmlHelper helper, PagedList<T> pagedList)
{
if (pagedList == null)
return Pager(helper,null, null);
return Pager(helper, pagedList.TotalPageCount, pagedList.CurrentPageIndex, null, null, null,null, null,null);
}
This pagerHelper is from Webdiyer
See Question&Answers more detail:
os