private void lnkNext_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { int max =0; using (databaseContext = CreateDatabaseContext()) { manager = new EventiManagerNew(databaseContext); max = manager.Count(); } startPage += 50; if (startPage >= max) { startPage = max - 50; if (startPage < 0) { startPage = 0; } } LoadData(); }