John said:
I thought I would experiment for the first time with an Image standard
control in VS 2005. I pressed create web site, I copied a jpg into the
App_Data folder, added an image control to Default.aspx and set the
ImageUrl to the jpg ( ~/App_Data/Picture.jpg ). The picture appears
in the designer, but when I run the page there is no picture.
There was no way for you to know it (except maybe by browsing through some
of the previous questions before posting yours - always a recommended
practice) , but this is a classic asp newsgroup. ASP.Net bears very little
resemblance to classic ASP so,
while you may be lucky enough to find a dotnet-knowledgeable person here who
can answer your question, you can eliminate the luck factor by posting your
question to a group where those dotnet-knowledgeable people hang out. I
suggest microsoft.public.dotnet.framework.aspnet.
Don't use the App_Data folder. Create a folder called images and put the
image file in that folder.
From
http://msdn2.microsoft.com/en-us/library/445z2s49.aspx:
When you create a Web site in Visual Web Developer, Visual Web Developer
creates a folder named App_Data below the current root folder. The folder is
designed to be a store for application data, including Access databases. The
App_Data folder is also used by ASP.NET to store databases that the system
maintains, such as the database for membership and roles. When Visual Web
Developer creates the App_Data folder, it grants Read and Write permissions
for the folder to the ASPNET or NETWORK SERVICE user account.
Note
As a security measure, files in the App_data folder are not served by
the Web server. Do not store any Web pages in the App_Data folder, because
users will see an error if they request a page from that folder.