protected void UpdateNextPrevious() { // Before we go, set the next/previous links List <int> lstFlights = new List <int>(LogbookEntry.FlightIDsForUser(CurrentFlight.User, Restriction)); int index = lstFlights.IndexOf(CurrentFlightID); if (lnkNextFlight.Visible = (index > 0)) { hdnNextID.Value = lstFlights[index - 1].ToString(CultureInfo.InvariantCulture); } if (lnkPreviousFlight.Visible = (index < lstFlights.Count - 1)) { hdnPrevID.Value = lstFlights[index + 1].ToString(CultureInfo.InvariantCulture); } }