Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
JavaScript
@foreach (var i in Model)
    {
        @:var stops_data = [[{"Geometry": {"Latitude": @i.tlat.ToString(), "Longitude": @i.tlng.ToString() } },

        @: { "Geometry": { "Latitude": @i.flat.ToString(), "Longitude": @i.flng.ToString() } }];

     }


What I have tried:

I am tired to use asp.net foreach to in javascript code. thanks for advance 
Posted
Comments
F-ES Sitecore 23-Apr-18 8:47am    
javascript runs on the client, what you have there is razor which runs on the server. View the source of your page via the browser and it should become clear why your code doesn't work.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900