Then there is a bug if the tag already has other tag helpers.
This works:
<label for="test" foo="1">test</label>
This does not:
<label asp-for="test" foo="1">test</label>
Sample tag helper:
[HtmlTargetElement("*", Attributes = FooAttributeName)]
public class FooTaghelper: TagHelper
{
private const string FooAttributeName = "foo";
public override void Process(TagHelperContext context, TagHelperOutput output)
{
output.Attributes.Add("foo", "bar");
}
}
Originally posted by @ChrisVanDijk in #12208