2

So, here is something bizzar: I have a partial view, which is been refreshed using jQuery:

<script>


$(function () {
    $('#loadFromMainFrame').click(function (e) {
        e.preventDefault();
        console.log("partial load begins here. ");
        $('#partialParkingDetails').load("/ParkingSpots/GetSearchResult");
    });
});
</script>

And the button of question and HTML partial is:

<div id="partialParkingDetails">
@{
    ViewBag.ListDescription = "Test List ParkingSpot:";
    Html.RenderAction("GetSearchResult");
}
</div>
<button id="loadFromMainFrame">Load from mainframe</button>
<div id="map-canvas"></div>

the Controller contains:

        public ActionResult GetSearchResult(int id=0, ....)
    {
        var parkingspots = from s in db.ParkingSpots select s;
        ....
        return PartialView("_SearchResult", parkingspots.ToList());
    }

Worth noting is that everything is working okay when google maps is not involved. whenever I start to try to update some google maps components, I get the error.

Are they related? what did I do wrong? thanks!

MiaoMiao
  • 317
  • 2
  • 7
  • Check what's the particular request generating this problem. All google public apis provide a mechanism to use it from other domains, that's what they are for. – Claudio Redi Jun 12 '15 at 21:40
  • Are you using the web services API? Those are meant for sever side communication. If you need something in the client web browser, consider using the JavaScript v3 API – kaho Jun 13 '15 at 15:06
  • Can you elaborate about this path? "/ParkingSpots/GetSearchResult".. It looks like you are fetching results for parking spots and dipalying them on Gmaps. Please make sure you fetching it correctly if that is not an HTTP request and display on the maps.. – AniV Jun 20 '15 at 00:41
  • It is correct that I am fetching result for a wrong controller. Sorry, I managed to figure it out. Thank you all for the help. – MiaoMiao Jun 21 '15 at 17:37
  • Check out the following sample which does exactly what you want. http://www.jmelosegui.com/map/basic/AjaxPartialView – Juan M. Elosegui Jul 18 '15 at 14:58

0 Answers0