Skip to content
Loading
  • +1
    Hi Sachin
     
       I have written below but not working
     
    @foreach (var item in Model.Locations)
    {
    @Html.DisplayFor(model => item.Id)
    @(item.IsActive ? "" : "")
     
    Thanks 
    +1
  • Sachin Singh
    +1
    make sure, you have referenced font awesome and also test this
     
    1. class="@Model.IsActive?'fa fa-check:'fa fa-times'">    
    +1
  • +1

    Hi Sachin

      Even in Active also it is printing X

      @if (item.IsActive)
                                        {
                                             
                                        }
                                        else
                                        {
                                           
                                        }

     

     

    Thanks 

    +1
  • Sachin Singh
    +1
    with if else
    1.   
    2. @if(item.IsActive)  
    3. {  
    4. class="fa fa-check">  
    5. }  
    6. else  
    7. {  
    8. class="fa fa-times">  
    9. }  
    10.   
    11.   
     
    +1
  • +1

    Hi Sachin

     

      I want Tick should appear in blue color. 

     

    @foreach (var item in Model.Locations)

    {

    @Html.DisplayFor(model => item.Id)

    @Html.DisplayFor(model => item.Description)

    @if(item.IsActive)

    {

    }

    else

    {

    }

     

    Thanks 

    +1