Consider a custom tag helper with this:
public class CustomTagHelper : TagHelper
{
[HtmlAttributeName("foo")]
public string? Foo { get; set; }
// ...
And this razor markup:
... foo="bar" ... />
The foo
attribute is missing in the rendered markup. If I remove the Foo
property, it remains. So the tag helper removes such public properties.
I can’t find anything in the docs that describe this behaviour, so I don’t know whether it’s normal or the problem lies elsewhere.
Is this expected behaviour? If so, why does it work this way?
(My workaround is to re-add that attribute manually.)