Marius Vasile

Marius Vasile

  • 602
  • 1.7k
  • 124.5k

asp.net core Change span color if @Html.DisplayFor has no data

Dec 23 2020 6:09 PM
  1. <div class="col-2">  
  2.             <span class="form-control form-control-sm">@Html.DisplayFor(model => model.PTWContent.PTWNo)</span>  
  3.         </div>  
I want to have the textbox color yellow if there is no data retrieved from the database and to display "N/A". Is possible?
 
 

Answers (3)