I have this code in the view:
foreach (var item in someList)
{
foreach (var item1 in item)
{
<tr >
<td class="clickableCell" id='@item1.idE'>@item1.name</td>
<td class="clickableCell"id='@item1.idE'>@ViewData["allroles"]</td>
</tr>
}
}
ViewData["allroles"] is a list of elements which contain idE and one string. How can I - for the second td, get the only the string, without another foreach?
Convert it to it's correct type and then use the indexing to get your wanted value.
Should be something like this (where i is the index of your current row):