Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 26, 2007 02:43 PM by GlennC
Sep 26, 2007 10:30 AM|LINK
I'm new to ASP so sorry in advance for what's probably a very simple question.
I've got an image button displaying a small calendar picture.
<asp:ImageButton ID="imgCal1" runat="server" Height="29px" ImageUrl="~/App_Data/calendar1.PNG"
OnClick="imgCal1_Click" Style="z-index: 113; left: 356px; position: absolute;
top: 331px" Width="38px" />
When I'm in the page designer I can see the image fine, but as soon as I run the page I just see the standard red cross. I tried using a jpg and a gif version as well.
What am I doing wrong???
Sorry again if this is a stupid question!
Sep 26, 2007 01:33 PM|LINK
If I am not mistaken the app_data folder in your application is one of the asp.net application folders. These folders are not visible to the world when running your application, and righly so. In your case you have your image in the app_data folder which
is used to store your database files, you wouldn't want the outside users to have access to this folder. Try moving your image to the root of the application or to another folder to store images for your application and adjust the path accordingly in the
ImageUrl property of your ImageButton.
Please remember to mark this post as answered if it helped you to answer your question, thanks.
Sep 26, 2007 02:43 PM|LINK
Thanks a lot Michael! [:D] That worked fine!