rsjethani
rsjethani

Reputation: 2227

System.Web.UI.WebControls.Image/ImageButton not displaying the image

I'm a newbie to Asp.net,learning from the Apress's Begining Asp.net...book.While very curious to see an image given by me on the browser,I'm stuck at the very first step, please help.

Configuration : Win7(32-bit),VS2008 Pro/.net 3.5,Firefox as default browser.

Now,In created a simple website(not web app) in C#,added three images(.png,.jpg,.gif) to the App_Data folder(using the solutn. explorer of course).Then added the Image control from the toolbox & in the ImageUrl property, selected one of the images->presses f5 to start in debugging mode but every time the browser displays the alternate text given by me.

Whats the problem?

Thanks.

Upvotes: 0

Views: 634

Answers (2)

Aristos
Aristos

Reputation: 66649

App_Data is a protected directory.

Place your image somewhere else, suggestion : on root create the /images/ dir and place them there.

Upvotes: 1

Tim B James
Tim B James

Reputation: 20374

Don't put the image in the App_Data folder. Put it anywhere else in the website as anything inside the App_data folder is not accessible via HTTP Requests.

Upvotes: 3

Related Questions