omit post back in making ( > )
i wanna make some thing like this ( << 1 2 3 4 >> ) end of my view . i do
like below . and it work .but i have post back. can i do it another way to
omit post back?
int page = (int)ViewBag.page;
int pages = (int)ViewBag.pages;
<div class="pagination pagination-left">
<ul>
<li>@Html.ActionLink("«", "MyAction", new { numberpage = pages
})</li>
@{for (int i = pages; i >= 1; i--)
{
if (i == page)
{
<li class="active">@Html.ActionLink(i.ToString(), "
MyAction ", new { numberpage = i })</li>
}
else
{
<li>@Html.ActionLink(i.ToString(), " MyAction ", new {
numberpage = i })</li>
}
}
}
<li>@Html.ActionLink("»", " MyAction ", new { numberpage = 1
})</li>
</ul>
</div>
No comments:
Post a Comment