新标签页在 IE 中不显示图像?

New tab is not showing image in IE?

我有一个视图,其中显示了将在新 window 中打开的图像链接。它在 Chrome 和 Firefox 中工作正常,但在 IE 中图像不显示。这是我的 cshtml 代码:

@for (var i = 0; i < Model.ImagesByteses.Count; i++)
{
    <a href="#">
        <img id="img @i" class="img-responsive" src="data:image/jpg;base64,@(Convert.ToBase64String(Model.ImagesByteses[i]))" onclick="window.open('data:image/jpg;base64,@(Convert.ToBase64String(Model.ImagesByteses[i]))', '_blank')" alt="" />
    </a>
}

代码在 Firefox 和 Chrome 中 运行 正常,但在 IE 中 window 打开但图像未显示。我该怎么办?

Internet Explorer 不允许导航 数据 URI。这是一项安全措施,旨在防止 certain spoofing attacks.

相反,您可以打开新的 window,然后将数据 URI 传递给它,也许使用 .postMessage