Hello
I have a problem with getting my pager-function to work. For some reason it doesnt like when I try to pass the current pageindex +1 to the same page for it to display next one.
<% if (Model.Users.HasNextPage) { %>
<%= Html.RouteLink(">>>", "Users", new { page = (Model.Users.PageIndex +1) })%>
<% } %>
If I only use: ”>>>”, ”Users) it works, although the next page function doesn’t work since it doesn’t assign next value.
If I debug Model.Users.PageIndex it has the value 0 when it loads the page (which it should have).
Somehow it doesn’t like the “new”-thingy at the end
I have swedish errors on, but it complains something about not finding the path/route/reference to the location of User, or how its set.
The actionresult looks like:
public ActionResult Users(int? page){
const int pagesize = 10;
var pagnatedUsers = new PaginatedList<User>(_us.GetUsers(), page ?? 0, pagesize);
return View("Users", new UserAdminEditViewModel { Users = pagnatedUsers });
}
Thanks in advance /M