Join Jess Chadwick for an in-depth discussion in this video Use tag helpers to simplify forms, part of Learn ASP.NET Core MVC: The Basics.
- [Instructor] The HTML helpers that I've shown…in various places in this course…are a great way to generate HTML in your views.…However, in this video I'm going to show you…how to gain more control over your HTML…while still taking advantage of ASP.NET Core MVCs…HTML generation capabilities…with a feature called tag helpers.…Using the tag helper approach,…you write all of your HTML exactly the way you want it…and then apply special attributes…that Razor picks up at runtime…and then dynamically modifies your HTML as it needs to.…
To demonstrate what tag helpers are and how to use them,…I'll rewrite this form using the tag helper approach…instead of the HTML helpers that I've been using.…Tag helpers are not included in any views by default.…So in order to use them, you must first add a reference…to them using the addTagHelper Razor directive.…The syntax for this directive is pretty straightforward.…Just specify the full name of the tag helper type…including the assembly that it lives in like this.…
This approach makes it very easy for you to pull in…
- Building blocks of ASP.NET Core applications
- Creating a new project
- Responding to HTTP requests
- Serving static files
- Understanding the MVC pattern
- Handling requests with controllers
- Rendering HTML with Razor
- Rendering data, view markup, and view logic
- Creating HTML forms
- Validating form data
- Reading and writing from a database with Entity Framework
- Improving the user experience
- Exposing data with a web API
- Securing your ASP.NET application
Skill Level Intermediate
1. The Basics
2. The Model-View-Controller (MVC) Pattern
Understand routing4m 24s
3. Render HTML with Views
4. Work with Data
5. Improve User Experience with Ajax and Web APIs
6. Secure Your Application
Next steps1m 42s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.