Skip to content
Loading
asp.net core error on int null
you gave plural names so I thought so. like it's a list of integers. 
+3
  • Sachin Singh
    it's like we are trying to fetch a value from an empty list, so the compiler doesn't understand this and throws error.
    +3
  • Marius Vasile
    Now is working, thank you Sachin. So both the model and int to be checked not null, just the value is not enough
    +2
  • Marius Vasile
    Is not the list, is a value, an integer
    +2
  • Sachin Singh
    sir, how a List can be 0? its count can be 0, not the list itself.
    1. @if (item.PTWSubsequent.PTWNoS.Count()>0)  
    2.    {  
    3.      class="col-md-1">  
    4.        class="form-control text-center btn-link" asp-page="/PTW/IsolationCertificate" asp-route-ptwid="@item.PTWId" asp-route-ptwsid="@item.PTWSId">@Html.DisplayFor(model => item..PTWNoS)  
    5.      
      
  •    }  
  •  
    +2