使用 Razor 和 JS 在信息 window 中嵌入图像

Embed image inside info window using Razor and JS

我有一些 Razor 代码来获取地图的详细信息,然后将此数据传递到 Javascript 代码中。一切都按预期工作,但随后我需要在 infoWindow 中添加图像,到目前为止它只是将其显示为文本。我的代码

@inherits umbraco.MacroEngines.DynamicNodeContext
<script type="text/javascript">

var MapLocations = [
@if (Model.Children.Where("Visible").Any())
{
    var naviLevel = Model.Children.Where("Visible").First().Level;

        foreach (var childPage in Model.Children.Where("Visible"))
        {
            var LatLng = @childPage.LatLng;
            var LocationName = @childPage.CustomerName;
            var Image = "<img src=\"" + @Model.MediaById(@childPage.image).umbracoFile + "\" alt=\"Alt text\" height=\"115\" width=\"83\">";

            <text>['@LatLng' + @LocationName + '@Image'],</text>
        }
 }
    ];

如何将图像添加到 infoWindow 中并确保它不显示为文本而是渲染图像?

你可以像@Html.Raw(...)那样输出吗?