@{ foreach (TestMachine item in Model)
{ <tr>
<td>@item.OS</td>
}}
In my @item.OS have only two choice. One [email protected]=window and @item.OS=Cloud. I want to show If @item.OS=window then it show @item.OS && fa fa-window icon.If @item.OS=Cloud then it show @item.OS && fa fa -clud icon.
If item.OS
is a string value matching the class name you want to use or it has a ToString()
override returning the same, you can use it directly with no need of if conditions:
<i class="fa [email protected]()" />
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments