I'm trying to learn ASP.NET Core and writing simple project using Google Maps API and Infobox.js. In index.cshtml I've got default code:
<a asp-action="Place" asp-route-id="@item.Id">Edit</a>
And everything works, this code leads me to
localhost/places/Place/1
Now I would like to add simillar link to infobox contentString (id = 1):
google.maps.event.addListener(marker, 'click', function ()
{
contentString = '< a asp-action="Place" asp-route-id="' + id + '">detail< /a>';
boxText.innerHTML = contentString;
ibOptions.content = boxText;
var ib = new InfoBox(ibOptions);
ib.open(map, marker);
map.panTo(ib.getPosition());
});
I can see the 'detail' label (it looks like a link - is blue and underlined) but i cannot click it - when I move mouse cursor over label - it does not change.
I write something like
contentString = '< a href="Place/' + id + '"> Details</a>';
It works (opens http://localhost/places/Place/1), but it is not the best way to do so, i think.
Could you help to change my code? Sorry for using quotation marks but I cannot do it another way.