public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.WalkathonInfo.Add(WalkathonInfo); await _context.SaveChangesAsync(); // return RedirectToPage("./Index"); return(RedirectToPage("../submit")); }
public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } BowlathonInfo = await _context.BowlathonInfo.FindAsync(id); if (BowlathonInfo != null) { _context.BowlathonInfo.Remove(BowlathonInfo); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } _context.Attach(BowlathonInfo).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { } return(RedirectToPage("./Index")); }