public override void Process(TagHelperContext context, TagHelperOutput output) { output.TagMode = TagMode.StartTagAndEndTag; output.TagName = "div"; output.Attributes.Add(new TagHelperAttribute("class", "tags")); output.Attributes.Add(new TagHelperAttribute("id", "tags")); var inputTagBuilder = new TagBuilder("input"); inputTagBuilder.Attributes.Add("name", Name); inputTagBuilder.Attributes.Add("class", Class); inputTagBuilder.Attributes.Add("id", Id); inputTagBuilder.Attributes.Add("placeholder", Placeholder); if (Required) { inputTagBuilder.Attributes.Add("required", null); } inputTagBuilder.Attributes.Add("value", SelectedItems.JoinAsString(",")); output.Content.AppendHtml(inputTagBuilder); }