var BalliStudnets = from balli in contextDB.tableBalli.ToList() where balli.ID_Gruppi == Grupp_ID && balli.ID_Disciplini == Disciplina_ID join s in contextDB.tableStudents on balli.ID_Studenta equals s.ID select new { Name = s.Name, Pos1 = balli.Pos1, Tek1 = balli.Tek1, Rub1 = balli.Rub1, Pos2 = balli.Pos2, Tek2 = balli.Tek2, Rub2 = balli.Rub2, Samost = balli.Samost, Dosdacha = balli.Dosdacha,Premial=balli.Premial,Itog=balli.Itog }; ViewBag.Vedomost = BalliStudnets; When passing the BalliStudnets object via ViewBag to a view, the compiler curses that there is no Name property. He does not see the properties. Is there an error in the request? If, then what can it be?
@foreach (var b in ViewBag.Vedomost) { <tr> <td>@i</td> <td style="text-align: left; padding:3px;"> @b.Name </td> <td>@b.Pos1</td> <td>@b.Tek1</td> <td>@b.Rub1</td> <td>@b.Pos2</td> <td>@b.Tek2</td> <td>@b.Rub2</td> <td>@b.Samost</td> <td>@b.Dosdacha</td> <td>@b.Itog</td> <td>@b.Premial</td> @{i++;} </tr> } 