Skip to main content

Posts

Showing posts with the label Unable to use MVC ViewBag List Items in Razor for-each loop

Use of MVC ViewBag List Items in Razor for-each loop

MVC  Razor for-each loop with   ViewBag List Items and t he code-sample for the r azor for-each loop with respect to the  ViewBag. @ foreach ( var employee in (( List < Employee >)ViewBag.Employees)) {     < span > @ employee.EmployeeCode </ span >     < span > @ employee.Name </ span > } Thank you!