Kiran Kumari

Kiran Kumari

  • NA
  • 142
  • 12.7k

How Can i add row number automatically in MVC?

Jun 7 2019 10:27 AM
hey everone following is my code i want to add serial no ? how can i do this?
  1. @foreach (var item in Model)    
  2.     
  3.  {    
  4.      string EventDate = item.EventDate.ToString("dd-MMM-yyyy");    
  5.      <tr>    
  6.          <td>    
  7.             //Here i want Serial No    
  8.          </td>    
  9.          <td>    
  10.              @Html.DisplayFor(modelItem => item.Event_name)    
  11.          </td>    
  12.          <td>    
  13.              @EventDate    
  14.          </td>    
  15.          <td>    
  16.              @Html.DisplayFor(modelItem => item.BS_EventType.EventType_dsc)    
  17.          </td>    
  18.             
  19.          <td>    
  20.                 
 thanks in advance

Answers (1)