I'm just starting to use ASP.NET MVC Tag Helpers which are great, but I cant work out how to conditionally set boolean attributes like the disabled attribute.
For example I have a tag helper that looks something like this:
<input asp-for="MyProperty" disabled="disabled" />
But I only want the disabled
part to be present when for example, @Model.IsDisabled
is true.
How do I do this?