Mid ASP.NET Core

Razor Page Handlers (OnGet, OnPost, etc.)?

  • Razor Pages use handler methods:

public class IndexModel : PageModel {

public void OnGet() { ... }

public IActionResult OnPost() { ... }

  • You can use asp-page-handler="Update" for custom methods.

More from ASP.NET Core Tutorial

All questions for this course