Reputation: 5930
I have an Image control in my asp.net page. I gave an image url from properties window but when I run my application, the image doesn't shown. The source code is here:
<asp:Image ID="imgMain" runat="server"
ImageUrl="~/ProductImages/Larges/Hydrangeas.jpg" />
And I am sure of the path is correct. I can see the picture on file explorer when I copy the image url from browser's source code.
Do you have any idea?
Upvotes: 0
Views: 943
Reputation: 11
I found that since my website was being launched as the Default Web Site, I had to also add the file in C:\inetpub\wwwroot**. ** represents the directory structure for the file location. Once I did that, the image then displayed via the browser.
Upvotes: 1
Reputation: 9166
I'm assuming that your original URL in the question is correct.
Without knowing anything more, I would start by checking if it's an autorization issue:
Also try to copy the URL on the image tag in the rendered page and paste it directly in the address bar of your browser. What happens?
Upvotes: 0