1
Answer

Image Control

Photo of Zeb Rehman

Zeb Rehman

13y
1.1k
1
Hi Friends!
I am getting problem in image control. I have dragged an image control and i want to assign url to it. It just accept the image url from its project folder. But i want to give it url from any where in my hard drive. Like....

myImage.ImageUrl = "C:\\Users\\Zeb-Ur-Rehman\\Documents\\a.jpg";

But it only accept the url from its project folder Like...

myImage.ImageUrl = "~/Images/a.jpg";

Thanks in advance.

Answers (1)

0
Photo of Senthilkumar
NA 15.2k 2.4m 13y
Hi Rehman,

I do no think you can assign the image from the hard drive any where.

It should be in web server and you can use the server.mappath() or you can use the relative url.

see more info on:
http://www.maconstateit.net/tutorials/aspnet40/ASPNET04/aspnet04-03.aspx