T
Tenacious
I find that I can call a function in my code behind file from Java
Script on the aspx page using this syntax:
Lat = <%= GetNextLatitude()%>
The function has to be static. No problem so far. When I put the
function in a for loop like so:
for(var i = 0; i < TotalPoints; i++)
{
Lat = <%= GetNextLatitude()%>
Lng = <%= GetNextLongitude()%>
LatLngPoints[cnt] = new GLatLng(Lat, Lng);
}
the return value from the function stays the same for each iteration
of the loop. Using the debugger I can tell that even if TotalPoints is
1000, the function in reality only gets called once. I can call it
more than once if it is not from a loop. Why does this happen? Is
there any other way that I can get an array from the code behind page
to the Java Script in the client?
Thanks
Script on the aspx page using this syntax:
Lat = <%= GetNextLatitude()%>
The function has to be static. No problem so far. When I put the
function in a for loop like so:
for(var i = 0; i < TotalPoints; i++)
{
Lat = <%= GetNextLatitude()%>
Lng = <%= GetNextLongitude()%>
LatLngPoints[cnt] = new GLatLng(Lat, Lng);
}
the return value from the function stays the same for each iteration
of the loop. Using the debugger I can tell that even if TotalPoints is
1000, the function in reality only gets called once. I can call it
more than once if it is not from a loop. Why does this happen? Is
there any other way that I can get an array from the code behind page
to the Java Script in the client?
Thanks