Created
February 27, 2016 21:23
-
-
Save kdhollow/8fb1a257e0a0a866c8b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
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