在视觉工作室中显示图像但在IIS中没有显示

时间:2017-06-17 19:36:31

标签: asp.net iis webforms

当我在visual studio中运行我的网站时,会显示图像,但在IIS中则不显示。

我加载图片的代码是:

    string strRootRelativePath = "~/Images/" + oTable[0].myImage;
    string strPath = Server.MapPath(strRootRelativePath);
    if (System.IO.File.Exists(strPath))
    {
        img.ImageUrl = strPath;
    }

感谢。

0 个答案:

没有答案