ASP.NET Core Tag Helpers

This course gives you everything you need to know to start using Tag Helpers in your ASP.NET Core MVC Razor View Pages. Learn how to use all the built-in Tag Helpers as well as how to expertly author your own.
Course info
Rating
(27)
Level
Intermediate
Updated
Jun 20, 2017
Duration
2h 48m
Table of contents
Course Overview
Introducing Tag Helpers
Authoring Your Own Tag Helpers
Leveraging Built-in Tag Helpers
Coding the Built-in Tag Helpers
Authoring an Advanced Tag Helper
Description
Course info
Rating
(27)
Level
Intermediate
Updated
Jun 20, 2017
Duration
2h 48m
Description

Tag Helpers are one of the new technologies in ASP.NET Core that making building web pages (Razor view pages) much easier and more intuitive for both designers and developers. In this course, ASP.NET Core Tag Helpers, you'll learn the fundamentals of Tag Helpers. First, you'll explore how to effectively use the 17 Tag Helpers built into ASP.NET Core on your Razor view pages to build forms. Next, you'll explore cache images. Finally, you'll customize anchor tags and build a JavaScript manager that takes advantage of many Tag Helper and ASP.NET Core features. By the end of the course, you'll be able to efficiently author both simple and advanced Tag Helpers.

About the author
About the author

Peter is the founder of Silicon Valley Code Camp and long-time software professional specializing in mobile and web technologies. He has also been a Microsoft MVP in ASP.NET since 2006.

More from the author
Building a Website with React and ASP.NET Core
Intermediate
3h 19m
22 May 2018
Securing Multi-tenant ASP.NET Web Apps
Intermediate
2h 37m
15 Sep 2017
More courses by Peter Kellner
Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone. My name is Peter Kellner, and welcome to my course, ASP. NET Core Tag Helpers. I'm a software engineer at the consulting company, 73rd Street Associates. Tag helpers are far and away the best new feature in ASP. NET Core. Razor view pages now look like clean HTML. This course is laser-focused on tag helpers. Some of the major topics we will cover include authoring our own tag helpers, using the tag helpers the ASP. NET team built for us, building our own JavaScript Manager, and using advanced tag helper features including dependency injection. By the end of this course, you'll know not only how to build your own tag helpers, but you'll be able to use and extend the built-in ones with the advanced knowledge of how they work. Before beginning the course, you should be familiar with ASP. NET MVC. You won't need to know anything about ASP. NET Core, as I will explain the differences Core brings to us. I hope you'll join me on this journey to learn ASP. NET Core Tag Helpers at Pluralsight.

Authoring Your Own Tag Helpers
Hi, this is Peter Kellner, and this module is all about authoring tag helpers in ASP. NET Core. In the last module, we authored a very simple tag helper named my-customer. All it really did was take a single attribute, name, did a hard-coded lookup, and based on that name, output an address. The idea was to give you an idea of what's happening on the C# code side of a tag helper. The tag helper coding model is very simple. The Razor view engine looks for valid tag helpers it knows about on the Razor view page. When it finds one, it calls its Process method; that's it. The design is amazingly simple, however, that simple design gives us a huge amount of power for what we can do. In this module, we will dive into the details of implementing real-world tag helpers, and all the intricacies that brings with it. On a side note, all demonstrations that include Visual Studio are using the 2015 version and include pre-release tooling to support tag helpers. This tag helper tooling is now only available in the now-released Visual Studio 2017, which means that for you to follow along in code you will need to have the latest version of Visual Studio 2017 installed. All our course downloads are setup for Visual Studio 2017. The tag helper API did not change, just the Visual Studio tooling.

Leveraging Built-in Tag Helpers
Hi, this is Peter Kellner, and this module is about the TagHelpers built into ASP. NET Core. Thankfully, not only did the ASP. NET team create the TagHelper architecture, but they also provided us with a set of professionally-built TagHelpers to help us build awesome Razor view pages, that is our cshtml view pages. These TagHelpers provide functionality for us that include enhancing our productivity when building forms, optionally including different HTML in our web pages based on environmental variables such as production or development, caching different parts of our web pages, and much more. In this module, we will learn how to use non-form-based built-in TagHelpers, and while we review them I'll provide insight into when and how to use the built-in TagHelpers to get the biggest advantage for you. On a side note, all demonstrations that include Visual Studio are using the 2015 version and include pre-release tooling to support TagHelpers. This TagHelper tooling is now only available in the now-released Visual Studio 2017, which means that for you to follow along in code you will need to have the latest version of Visual Studio 2017 installed. All our course downloads are set up for Visual Studio 2017. The TagHelper API did not change, just the Visual Studio tooling.

Coding the Built-in Tag Helpers
Hi, this is Peter Kellner. In this module, expect to learn all about how ASP. NET Core TagHelpers make building HTML forms easy and fun again. Before diving into building forms with TagHelpers, let's do a little level setting to make sure we are all on the same page when it comes to what HTML forms are, and how they work. A web form, or HTML form on a web page, allows a user to enter data that is sent to the server for processing. Forms can resemble paper or database forms, because web users fill out the forms using checkboxes, radio boxes, or text fields. According to Wikipedia, a web form allows a user to enter data into a browser that is then sent to a server. That's a really simple definition, and certainly describes the basic Web Form as most people knew it 15 years ago. Now, however, there is a lot more to it. The server sends data down to the browser to pre-fill the HTML form, then often we have validation in the browser of that form data, and finally, modified data is posted back up to the server from the browser, and, of course, the server validates the post data again. On a side note, all demonstrations that include Visual Studio are using the 2015 version and include pre-release tooling to support TagHelpers. This TagHelper tooling is now only available in the now-released Visual Studio 2017, which means that for you to follow along in code you will need to have the latest version of Visual Studio 2017 installed. All our course downloads are set up for Visual Studio 2017. The TagHelper API did not change, just the Visual Studio tooling.

Authoring an Advanced Tag Helper
Hi, this is Peter Kellner, and in this module we will build TagHelpers that use many of the popular features TagHelpers are known for. More specifically, we're going to create a script manager service that works seamlessly with a new BodyTagHelper, as well as a new ScriptTagHelper. So why do we need a script manager? Well, you're probably thinking we already have tons of script managers, why do we need another one? Well, the reason is that we don't have a script manager that integrates with TagHelpers that themselves require JavaScript. Watch and learn what I mean by that. I realize what I just said is a bit vague, but if you follow along over the next couple of sections, it will become 100% clear why we need such a script manager. On a side note, all demonstrations that include Visual Studio are using the 2015 version and include pre-release tooling to support TagHelpers. This TagHelper tooling is now only available in the now-released Visual Studio 2017, which means that for you to follow along in code you will need to have the latest version of Visual Studio 2017 installed. All our course downloads are set up for Visual Studio 2017. The TagHelper API did not change, just the Visual Studio tooling.