I have an image on an aspx page like:
<asp:Image ID="imgOrgLogo" runat="server" Width="50px" Height="35px" AlternateText="Image Not Found" />
I have a ready path for it in the database, and I get the image name from the database and setting its path as:
string path = obj.ExecuteScalar(sql);
imgOrgLogo.ImageUrl = "/OrgImages/" + path;
imgOrgLogo.DataBind();
from line to line I get the image name.
I checked the OrgImages folder contains the specified image.
But after running this code, the image is not visible.
When I checked the item from the browser, it shows:
<img id="MainContent_imgOrgLogo" src="" alt="Image Not Found"
style="height:35px;width:50px;">
The path does not pass.
What is wrong in my code?
Please help me.
source
share