I'm having an issue with a callback. I'm not even getting an error in Firebug. If I alert before and after the getjson call both alerts show but the getjson call doesn't fire.
public ActionResult TestPage()
{
return View();
}
public ActionResult LoadMapLonLats(int mapId)
{
//some code
return Json(_myMaps);
}
$("#Search").click(function() {
$.getJSON("LoadMapLonLats", { mapId: 73 }, loadDbMap);
});
function loadDbMap(maps) {
alert('m');
$.each(maps, function(i) {
alert(maps[i]);
});
}
As long as I leave TestPage without a parameter is works. If I add a parameter to TestPage(int id) then the call back to LoadMapLonLats doesn't work. Seems odd. Of course TestPage is the page I'm loading so I need to do some work here before rendering the page. Not sure why adding a parameter to the view would break the callback to another function.
//this breaks he callback to LoadMapLonLats
public ActionResult TestPage(int id)
{
return View();
}
Any ideas? Seems like this may be related, if not sorry I can post a new thread.