There's more...

In the previous example, the root HTML tag inserted is section. We indicate that by giving a HTML tag name as the value to output.TagName. With output.Content.SetHtmlContent, we inject HTML into the section element.

Get ASP.NET Core MVC 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.