I have a table with repeating rows of clients, I would like to add a client identifier to the ID attribute of my table rows as follows:
<tr id="row<customer id>"></tr>
I am trying to add this code:
@foreach(var c in Model) { <tr id="row@c.id"></tr> }
Which gives me the following result:
<tr id="row@c.id"></tr> <tr id="row@c.id"></tr>
and etc.
But I would like to:
<tr id="row1"></tr> <tr id="row2"></tr>
and etc.
I also tried adding <tr>row@{c.id}</tr> , but that didn't work.
asp.net-mvc asp.net-mvc-3 razor
Martin Sep 12 2018-10-18 18:44
source share