First off, I'm pretty new to MVC and jQuery. We apologize if my question or terminology is incorrect.
I currently have a view in my MVC application that displays a list of addresses. On the same page, I also have a map on which I want to map these locations.
I am trying to find the "right" way to get a list of address objects in javascript in a view so that it can be repeated and displayed.
I saw some solutions that require a getJSON call to the controller from javascript code. I want to avoid this solution as it requires another trip to the database and web server. All the information that I need to display the addresses on the map is already presented in the view via ViewData.
I also saw a solution in which javascript could access the data passed to the view through ViewModel.Data, however this example worked on a single object, as opposed to a list.
I would appreciate if anyone had any advice or resources.
thanks
source share