Skip to content

jbagga/TagHelperComponentSample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 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 for a video tutorial!

Custom TagHelperComponentTagHelper Sample

This is an example of how 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 for a video tutorial!

About

A sample for TagHelperComponent

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published