Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@{
var pageInfo = string.Empty;
if (Model.AirportSearchResults.Count > 0)
{
var first = @Model.Skip + 1;
var last = @Model.Skip + pageSize;
pageInfo = first + " - " + last + " of " + @Model.Count;
}
int prevSkip = @Model.Skip - pageSize;
int nextSkip = @Model.Skip + pageSize;
}
@{
if (prevSkip < 0)
{
prevSkip = 0;
}
if (nextSkip > (int)Model.Count)
{
nextSkip = @Model.Skip;
}
}
@if (Model.AirportSearchResults.Count > 0)
{
<p style="margin: 0">
@Html.ActionLink("Previous", "Search", new AirportSearch() {Top = pageSize, Skip = prevSkip, Filter = @Model.Filter})
@pageInfo
@Html.ActionLink("Next", "Search", new AirportSearch() {Top = pageSize, Skip = nextSkip, Filter = @Model.Filter})
</p>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment