Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Custom Tag Helper for rendering a LinkButton-like anchor in ASP.NET Core
public class LinkButtonTagHelper : TagHelper
public override void Process(TagHelperContext context, TagHelperOutput output)
const string HIDDEN_FIELD_ID = "form_marker";
output.TagName = "a";
output.PostElement.SetHtmlContent($@"<input type=""hidden"" id=""{HIDDEN_FIELD_ID}"" />");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment