27 Using the forms tag helpers

This chapter covers

  • Using ASP.NET Core tag helpers to transform form elements
  • Transforming input elements and formatting their contents
  • Generating label elements from model properties
  • Generating select and option elements
  • Protecting forms against cross-site request forgery

In this chapter, I describe the built-in tag helpers that are used to create HTML forms. These tag helpers ensure forms are submitted to the correct action or page handler method and that elements accurately represent specific model properties. Table 27.1 puts the form tag helpers in context.

Table 27.1 Putting form tag helpers in context

Question

Answer

What are they?

These built-in tag helpers transform HTML form elements. ...

Get Pro ASP.NET Core 7, Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.