I’m iterating through my Model in javascript and I get a compilation error :
” The name ‘i’ does not exist in the current context”
alerting i is working ok. How can I escape the Razor to get the i please ?
for(i=0; i<@Model.Count();i++)
{
//alert(i);
alert(@Model.ElementAt(i).Description.ToString());
}
You are mixing javascript and Razor. Try only using javascript for the alert call.