Skip to content

CodeConversations/Tag-Helper-Components-with-Jass-Bagga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TagHelperComponent Sample

This is an example of how to modify the HeadTagHelper and the BodyTagHelper in ASP.NET MVC 2.0.

To get started, download Visual Studio 2017 and .NET Core 2.0.0 preview1.

Clone the repository and open the TagHelperComponentSample.sln

In the MyTagHelperComponent.cs file, change the TagHelperOutput to modify the <head> or <body> HTML element any way you want.

To learn more, head to Channel 9. A video tutorial will be posted soon!

Custom TagHelperComponentTagHelper

To create a custom TagHelperComponentTagHelper similar to the HeadTagHelper and the BodyTagHelper in ASP.NET Core MVC 2.0:

  • In the MyTagHelper file, change the [HtmlTargetElement] to any HTML element of your choosing like the <p> or <script> tags. The sample uses <footer> as an example, to modify all <footer> tags in the application.

  • In the MyTagHelperComponent.cs file, change the TagHelperOutput to modify the <head> or <body> or the HTML element of your choice (the one you created in the step above) any way you want.

To learn more, head to Channel 9. A video tutorial will be posted soon!

About

Code sample from our interview with Jass Bagga on Code Conversations

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published