public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Student = await _context.Student.FirstOrDefaultAsync(m => m.ID == id); if (Student == null) { return(NotFound()); } ViewData["CourseID"] = new SelectList(_context.Set <Course>(), "ID", "CourseName"); return(Page()); }
public IActionResult OnGet() { ViewData["CourseID"] = new SelectList(_context.Set <Course>(), "ID", "CourseName"); return(Page()); }