The ASP.NET Core Form Tag Helpers Cheat Sheet

added by DotNetKicks
1/22/2019 9:59:46 PM

1 Kicks, 176 Views

How to get data from your HTML forms to ASP.NET Core (using Tag Helpers). The Form (MVC) The Form (Razor Pages) Labels Text Inputs Passwords TextAreas Dropdown Lists (Select) Hidden Inputs Checkboxes Radio Buttons The Form itself (MVC) CSHTML @model FormsCheatSheet.Models.Example Submit Form The Controller public class ExampleController : Controller { public IActionResult Index() { return View(new Example()); } [ValidateAntiForgeryToken] public IActionResult Save(Example model) { // do something with model e.