I have a PagedList on one of my actions such as
public ActionResult search(int? page)
{
}
The PagedList works correctly but my question is how can I findout what page the user is in and then change the background color on that page? for instance the PagedList at the bottom of the page are shown like
1 2 3 4 5
If the user is on like page 3 I would like to change the background color of the link that shows that page number, here is how my view is..
@if (Model.HasPreviousPage)
{
if (Model.PageNumber > 1)
{
@Html.ActionLink(String.Format("{0}", (Model.PageNumber - 1).ToString()), "index", new { page = Model.PageNumber - 1 })
@Html.Raw(" ");
}
}
@if (Model.HasNextPage)
{
if (Model.PageNumber + 1 <= Model.PageCount)
{
@Html.ActionLink(String.Format("{0}", (Model.PageNumber + 1).ToString()), "index", new { page = Model.PageNumber + 1 })
@Html.Raw(" ")
}
}
The page number in the browser are shown as /search?page1 .../search?page2 etc. anyways any help or suggestions would be great !!