I'm just starting out with mvc and have the following code:
@model AzureDemo.Models.User
@{
ViewBag.Title = "Interests";
}
<h2>Interests</h2>
<p>
@Html.ActionLink("Logout", "Logout")
</p>
<table>
<tr>
<th>
Interests
</th>
</tr>
@foreach (var interest in Model.Interests) {
<tr>
<td>
@Html.Display(interest)
</td>
//Tried like this
<td>
@Html.Display("id", interest.ToString())
</td>
</tr>
}
</table>
The Interests property in User is simply a list of strings. I'm trying to display each interest in a table for a user. I also tried putting a string like "test" in Html.Display, or tried using ToString() but still nothing.
<td>@interest</td>