Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am using this code for display image its not displaying in Image Box.

Image1.ImageUrl = Server.MapPath(@"~/Images/4.jpg");

Please help me.

Thanks
Ankit Agarwal
Software Engineer
Posted

use
C#
Image1.ImageUrl = "~/Images/4.jpg";

MapPath will give the local path but ImageUrl need relative of absolute URL
 
Share this answer
 
Comments
aarif moh shaikh 4-Jul-15 6:52am    
agree with you ...
Agarwal1984 4-Jul-15 6:53am    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900