Today I had a problem of adding markers onto a google map. I didn't really want to create a service to handle the request and return an array. So instead I tried doing something simpler.
1 2 3 |
@foreach(var pins in Model.Pins) { {latLog: [@Html.DisplayFor(item => pins.Lat), @Html.DisplayFor(item => pins.Log)], data: '@Html.DisplayFor(item => pin.Name'}, } |
This obviously didn't work. Razor was getting confused; it didn't know which one was the script and which one