开发者

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

开发者 https://www.devze.com 2023-01-18 13:51 出处:网络
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.

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 add开发者_JAVA技巧ed 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.


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.


App_Data is a protected directory.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号