How to show @item value with its own icon

yashu verma
    @{ 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.

Michal Klouda

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to show drawing brush as a Menu item Icon

From Dev

How to give each Firefox profile its own application icon in Plasma

From Dev

How can I give a script its own icon in the Unity launcher?

From Dev

How to show selected item with icon in a list to user-ionic3

From Dev

Every activity shows its own icon

From Dev

How should I reset a less variable using its own value

From Dev

How should I reset a less variable using its own value

From Dev

How to make spreadsheet cell return its own value - 1?

From Dev

How can I start a separate instance (not profile) of Chromium, with its own icon?

From Dev

How can I start a separate instance (not profile) of Chromium, with its own icon?

From Dev

How to iterate through a collection, and place each item in its own Prawn grid square?

From Dev

Delphi XE5 Android : how to make each listview item have its own template?

From Dev

How to iterate through a collection, and place each item in its own Prawn grid square?

From Dev

How can I make one <a> item with its own class a different colour from others?

From Dev

Rectrict user to its own page and show their own project

From Dev

Python: How to do a program that can show specific part of its own code?

From Dev

How can I change the icon of the navigation drawer and its item android studio

From Dev

uwp: how to change background color of listview item based on its value?

From Dev

How do I get Visual Studio Code to show its icon on the taskbar in Windows 10?

From Dev

Java - How to show an input dialog having a dropdown list with an icon for each item?

From Dev

How does this strange condition happens when show menu item icon in toolbar overflow menu?

From Dev

Assigning an int's own address to its value

From Dev

Update id with linkified script in its own value

From Dev

How to show keys in a Motobit Multi.Dictionary by the given item value?

From Dev

How to make the selectList to show the default value as the selected item in jquery

From Dev

How to change the icon of a listview item

From Dev

How to change the icon of a listview item

From Dev

Who should own the state value of an item?

From Dev

How can I move each value in a data frame column into its own column?

Related Related

  1. 1

    How to show drawing brush as a Menu item Icon

  2. 2

    How to give each Firefox profile its own application icon in Plasma

  3. 3

    How can I give a script its own icon in the Unity launcher?

  4. 4

    How to show selected item with icon in a list to user-ionic3

  5. 5

    Every activity shows its own icon

  6. 6

    How should I reset a less variable using its own value

  7. 7

    How should I reset a less variable using its own value

  8. 8

    How to make spreadsheet cell return its own value - 1?

  9. 9

    How can I start a separate instance (not profile) of Chromium, with its own icon?

  10. 10

    How can I start a separate instance (not profile) of Chromium, with its own icon?

  11. 11

    How to iterate through a collection, and place each item in its own Prawn grid square?

  12. 12

    Delphi XE5 Android : how to make each listview item have its own template?

  13. 13

    How to iterate through a collection, and place each item in its own Prawn grid square?

  14. 14

    How can I make one <a> item with its own class a different colour from others?

  15. 15

    Rectrict user to its own page and show their own project

  16. 16

    Python: How to do a program that can show specific part of its own code?

  17. 17

    How can I change the icon of the navigation drawer and its item android studio

  18. 18

    uwp: how to change background color of listview item based on its value?

  19. 19

    How do I get Visual Studio Code to show its icon on the taskbar in Windows 10?

  20. 20

    Java - How to show an input dialog having a dropdown list with an icon for each item?

  21. 21

    How does this strange condition happens when show menu item icon in toolbar overflow menu?

  22. 22

    Assigning an int's own address to its value

  23. 23

    Update id with linkified script in its own value

  24. 24

    How to show keys in a Motobit Multi.Dictionary by the given item value?

  25. 25

    How to make the selectList to show the default value as the selected item in jquery

  26. 26

    How to change the icon of a listview item

  27. 27

    How to change the icon of a listview item

  28. 28

    Who should own the state value of an item?

  29. 29

    How can I move each value in a data frame column into its own column?

HotTag

Archive