Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,

In my asp.net project, i have image folder that has my images,
and another folder that has Specific.aspx page and Master Page for it.

I cannot reach images from Specific.aspx page.

That is my try:

HTML
<img alt="Start" class="butClass" src="~/img/toolbar.Start.gif" />


but it not work.
Posted
Comments
Sergey Alexandrovich Kryukov 5-Sep-11 13:53pm    
I can imagine what may be not working here, but generally avoid "it does not work", explain exactly what you observe.
--SA
MrLonely_2 5-Sep-11 21:10pm    
Ok, thanks SAKryukov, i will do it.

Don't use "~/". Must be "./img/toolbar.Start.gif" or just "img/toolbar.Start.gif". Of course, make sure the sub-directory "img" is in the same directory where you have the page file with this code. In other words, use relative paths; relative to the location of the page using them.

—SA
 
Share this answer
 
Comments
Monjurul Habib 5-Sep-11 14:47pm    
nice explain,5!
Sergey Alexandrovich Kryukov 5-Sep-11 15:42pm    
Thank you, Monjurul.
--SA
MrLonely_2 5-Sep-11 21:14pm    
I need the sub-directory "img" to be in root folder as it used by more than page in the project.
Thank you SAKryukov
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 5-Sep-11 15:43pm    
The do make it clear, my 5.
--SA
Monjurul Habib 6-Sep-11 15:34pm    
thank you
The path is seems to be wrong. The easiest way to resolve this, Right click on the "Red Cross Icon" on the page ( Which is coming due to invalid path ) and check the what path it is taken. From there you will able to understand what is wrong. :)
 
Share this answer
 

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