asp.net mvc 4 - Passing data from a controller to a view (MVC) -
I'm having a small problem where I can not send the data to the view.
I have the controller I have this view I get this error on my web page: System. Selection. Generic List 1 [System.String] When I step through my code I see that 20 records are stored in my visual bag, my problem is that I can not see them. Am I making the wrong call? Thanks in advance for help In your foreach, you need to use defined variables. In this situation, I do not think you need Assistant to try changing your code ViewBag.InvalidParts = invalid;
& lt; H2 & gt; @ html.DisplayText ("InvalidParts") & lt; / H2 & gt;
@foreach (ViewBag.InvalidParts in varB invalid) {& lt; Text & gt; & Lt; H2 & gt; @ Invalid & lt; / H2 & gt; & Lt; / Text & gt; }
Comments
Post a Comment