I'm trying to access the elements of a list stored in ViewBag as follows:
function equipamentoTemControle() {
for(i = 0; i < @ViewBag.qtdEquipamentos; i++) {
var contratocod = @ViewBag.DadosEquipamentos[i].contratocod;
}
}
But when trying to access contratocod of attribute index i the Visual Studio says that the variable i does not exist. How do I access ?