Clarify conditional attributes (#12926)

pull/12932/head
Luke Latham 2019-06-18 12:54:08 -05:00 committed by GitHub
parent 78138362d6
commit c9229f3373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -667,11 +667,11 @@ Razor directives are shown in the following table.
| [\@namespace](xref:mvc/views/razor#section-6) | Sets the namespace of the generated component class. |
| [\@attribute](xref:mvc/views/razor#section-7) | Adds an attribute to the generated component class. |
**Conditional attributes**
**Conditional HTML element attributes**
Attributes are conditionally rendered based on the .NET value. If the value is `false` or `null`, the attribute isn't rendered. If the value is `true`, the attribute is rendered minimized.
HTML element attributes are conditionally rendered based on the .NET value. If the value is `false` or `null`, the attribute isn't rendered. If the value is `true`, the attribute is rendered minimized.
In the following example, `IsCompleted` determines if `checked` is rendered in the control's markup:
In the following example, `IsCompleted` determines if `checked` is rendered in the element's markup:
```cshtml
<input type="checkbox" checked="@IsCompleted" />