This is for a Blazor InteractiveServer app. I am creating the html for an Azure Maps popup. I create the html as follows:
var html = new StringBuilder("<div style=\"padding:10px;color:black\"><p>Click to go to the specific profile</p><ul>");
foreach (var pin in clusters)
{
var name = ConvertToString(pin.Properties["Name"]);
var url = ConvertToString(pin.Properties["ProfileUrl"]);
var id = ConvertToInt(pin.Properties["Id"]);
html.Append($"<li><button @onclick=\"OnSelectPin(id)\">{name}</button></li>");
}
html.Append("</ul></div>");
When the user clicks - it does not call the OnSelectPin() method.
private void OnSelectPin(int id)
{
// do something
}
How can I get the html I pop up to call OnSelectPin()?