Search code examples
c#asp.net-coreasp.net-core-tag-helpers

How can I stop a Tag Helper from being used automatically?


For example: I want my <form> tag to render as-is. Instead it is auto-generating all the other goodies with it.

How do I turn off tag helpers for that one specific tag?


Solution

  • You can add a ! before the tag name to prevent the tag helper from executing:

    <!form method="post">
        <button type="submit">Submit</button>
    </!form>
    

    Source