Posts

Showing posts from December 9, 2018

Custom tag helper not working

Image
up vote 14 down vote favorite 1 I followed a few guides on creating a custom tag helper for ASP Core. This is my helper: using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using System; namespace ToolControlSystem.TagHelpers { [HtmlTargetElement("description", Attributes = DescriptionAttributeName, TagStructure = TagStructure.NormalOrSelfClosing)] public class DescriptionTagHelper : TagHelper { private const string DescriptionAttributeName = "asp-for"; [HtmlAttributeName(DescriptionAttributeName)] public ModelExpression Model { get; set; } public override void Process(TagHelperContext context, TagHelperOutput output) { base.Process(context, output); var description = GetDescrip