MVC - Pass List via ViewBag to View
11,656
You need the @ symbol before your text like this:
@item.ProgID
Author by
Nate Pet
Updated on June 04, 2022Comments
-
Nate Pet almost 2 years
I have a viewbag that has a list of items in it.
ViewBag.ProgList = resultlst;
I am not sure why when I do the following in the view it is not able to retrieve the values.
@foreach (var item in ViewBag.Progist) { item.ProgID }
The result simply shows item.ProgID without any actual values.