Thoughts from the Wet Coast
The musings of an ASP.NET Developer from Canada's We(s)t Coast
In a previous post, I introduced the concept of Tag Helpers in ASP.NET Core. In this post I will show how you can create your own Tag Helper. As an example I will rewrite my User Profile ViewComponent as a Tag Helper. As I mentioned in the previous post I can use the User Profile View Component as a Tag Helper by using the built-in ViewComponent Tag Helper, but this exercise will show how we can build it as a pure Tag Helper.
I have been making some updates to my Blog Application (Naif.Blog) over the last few weeks, as I both enhance the application with some new features and bring it up to the latest version of ASP.NET Core (v2.1). In my implementation of theming I have allowed themes to “override” any of the default Views. This makes the theming engine very powerful but it also makes it potentially harder for theme creators as they would need to understand some basic Razor. This is where Tag Helpers come in - Tag Helpers provide a way to express functionality in HTML markup. In this blog I review the built-in Tag Helpers.
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.