display list Viewbag in view of string code example
Example 1: viewBag as a list
<td>@((ViewBag.data as ICollection<Person>).First().FirstName)</td>
Example 2: viewBag as a list
<ul>
@foreach (var person in ViewBag.data)
{
<li>@person.FirstName</li>
}
</ul>