I am trying to write a simple for in JS which uses an element from a list declared in C# code behind. Actually there is a problem here: ['i'] – compiler doesn’t know what is i.
How can I write this for properly?
for (var i = 0; i < '<%= poz.Count %>'; i++) {
var Latitude = '<%= poz['i'].Latitude %>';
}
your counter variable is not defined in your c# code. It is a javascript variable.
If you want the values of your poz object to be available to javascript you need to write them out to some javascript structure with a loop written in c#.