This code will help you to understand how to render elements with conditional attributes.
DOM attributes are rendered based on .NET parameters. If the parameter value is true, the attribute is rendered minimized, otherwise it’s not. Refer to the code example to render the checked attribute conditionally.
<input type="checkbox" checked="@IsChecked"> @code { [Parameter] public bool IsChecked { get; set; } }
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
DOM attributes are rendered based on .NET parameters. If the parameter value is true, the attribute is rendered minimized, otherwise it’s not. Refer to the code example to render the checked attribute conditionally.
need an explanation for this answer? contact us directly to get an explanation for this answer