Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<% int i; if (this.Model.Featured){%>
     <div id="Tab-1">
      <table class="Activity">
       <% i = 1; foreach (var activity in this.Model.TranzTacho)
                 { %>
                 <tr class=" <%= i%2==1? "Gray" : "White" %> ">
                 <td class="Date"><%=activity.Date%></td>
                 <td class="Text"><%=activity.Text%></td>
                 </tr>
                 <% i++; } %>
       </table>
      </div>
 <% } %>
Posted
Updated 17-Apr-23 3:08am
v2

1 solution

Razor
@{
    var i = 1;
}

@if(this.Model.Featured){
    <div id="Tab-1">
    <table class="Activity">
    @foreach(var activity in this.Model.TranzTacho)
     {
        <tr class=" @i%2==1? "Gray" : "White"> 
                 <td class="Date">@activity.Date</td>
                 <td class="Text">@activity.Text</td>
                 </tr>
                i++;
     }

  
      
}

This is an attempt to convert to Razor.
I hope this helps you.
Please post back your queries if any.
Thanks. :)
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900