Q:

ASP.NET image control does not show the image

I am using an image control, but it does not display any image. When I see its viewsource, it displays the image path correct. The URL of the page is devweb.tsgdomain.com/americaneyenew/News.aspx
lblTitle.Text = dtNews.Rows[0]["NewsTitle"].ToString();
string strPhotosImage = dtNews.Rows[0]["Image"].ToString();
if (strPhotosImage != string.Empty)
{
    string Extension = strPhotosImage.Substring(strPhotosImage.LastIndexOf("."));
   // Server.MapPath("~/ENewsLetterFileUpload/NPH_" + strOriginalFileName + "_1.PDF");
    ImgNews.ImageUrl = Server.MapPath("~/ENewsImage/" + iNewsID + "_1" + Extension);
        //Server.MapPath("~/ENewsImage/" + iNewsID + "_1" + Extension);
        //"../ENewsImage/" + iNewsID + "_1" + Extension;
    ImgNews.Visible = true;
}
else
{
    ImgNews.Visible = false;
}

Please help me as soon as possible.

A:

you shouldn't use as server.mappath
ImgNews.ImageUrl = "~/ENewsImage/" + iNewsID + "_1" + Extension; 

would be enough.

