简体   繁体   English

图像未在Chrome Asp.Net中显示

[英]Image not displaying in chrome Asp.Net

I am dynamically loading an image in a div. 我在div中动态加载图像。 Image is loading in firefox but not in chrome.I have disabled adblock but still image is not loading. 图片在Firefox中加载,但在chrome中不加载。我已禁用adblock,但静态图片未加载。

I am storing image path in database and image in a root folder. 我将图像路径存储在数据库中,并将图像存储在根文件夹中。 Any help will be really appreciated. 任何帮助将不胜感激。

str.Append("<div style='padding:20px;margin-top:10px;'>");
                str.Append("<table  border='1' style='width:350px;margin-top:20px;font-family:arial;font-size:12px;'>");

                str.Append("<tr><td style='width: 150px;'><center><img src='" + Imagesrc + "' alt='2'  style='width:150px;height:150px'/>"
                    + "</center></td></tr>");

                str.Append(" </table>");

                str.Append("</div>");

Imagesrc = "Images/img1.png";

try 尝试

Imagesrc = @"Images/img1.png";

or 要么

Imagesrc = "Images//img1.png";

But your code is very strange. 但是您的代码很奇怪。 Why you generate your web layout dynamically? 为什么要动态生成Web布局? Why you dont use ASP.NET MVC or WebForms? 为什么不使用ASP.NET MVC或WebForms?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM