Image1.ImageUrl= "C:\\Documents and Settings\\Administrator\\Desktop\\4014_thumb.jpg";

This simple code is not working. What may be the problem.
Its not displaying anything.

If i give the url in the properties of the image button it works but if i assign like above it doesnt.

Recommended Answers

All 3 Replies

Since it looks like you are working locally, if your html or aspx file is also sitting on your desktop, then you can simply path as 'thumb.jpg'

You are referring a local file system in web application. It is not adviceable.

Copy your image file to your asp.net web site folder and refer like

Image1.ImageUrl= "4014_thumb.jpg"; //if you have the file in the root folder
Image1.ImageUrl= "/images/4014_thumb.jpg"; //if you have the file in the sub folder(within 'images' folder)

Hi coollife, u need to place that image in the project folder in the soln explorer i.e., from the path that ur running the appln. Then it will give the image of the givenpath

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.