Directory struture

Z

Zeba

Hi guys,

I've got a confusing problem regarding my directory structure. My
directory structure is something like

StoreCore(root directort to which IIS points)
images >>logo.jpg
>>Header2
>>>BuyImage.jpg
>>SearchFolder
>>>ItemSearch.aspx
>>ViewItemFolder
>>>ViewItem.aspx
default.aspx


The masterpage.master uses the images BuyImage.jpg and logo.jpg.
Masterpage.master is used by the three aspx pages ItemSearch.aspx,
ViewItem.aspx and default.aspx.

If I give the src (address) for the image as
/StoreCore/images/logo.jpg
/StoreCore/images/Header2/BuyImage.jpg
Then All Images appear properly in all the aspx pages
If I give the src (address) for the image as
images/logo.jpg
images/Header2/BuyImage.jpg
Then logo appears properly only in default.aspx but BuyImage appears
properly in all three aspx pages.

What is the reason for this ?? Also, why cant we give /images/
logo.jpg ?

Thanks !
 
M

marss

Zeba said:
Hi guys,

I've got a confusing problem regarding my directory structure. My
directory structure is something like

StoreCore(root directort to which IIS points)


The masterpage.master uses the images BuyImage.jpg and logo.jpg.
Masterpage.master is used by the three aspx pages ItemSearch.aspx,
ViewItem.aspx and default.aspx.

If I give the src (address) for the image as
/StoreCore/images/logo.jpg
/StoreCore/images/Header2/BuyImage.jpg
Then All Images appear properly in all the aspx pages
If I give the src (address) for the image as
images/logo.jpg
images/Header2/BuyImage.jpg
Then logo appears properly only in default.aspx but BuyImage appears
properly in all three aspx pages.

What is the reason for this ?? Also, why cant we give /images/
logo.jpg ?

Thanks !

Use the relative path to the image:

~/images/logo.jpg
~/images/Header2/BuyImage.jpg

Here symbol "~" means the root directory
 
Z

Zeba

Hey,

I just tried that now. But in now none of the images appear in any of
the aspx pages at all. What is the problem ?!
Thanks !
 
Z

Zeba

If anyone knows any good links for referencing / directory structure
etc. can pls help
Thanks !
 
M

marss

Zeba said:
Hey,

I just tried that now. But in now none of the images appear in any of
the aspx pages at all. What is the problem ?!
Thanks !

If you use <img .../> instead of <asp:Image .../> then add
runat="server" attribute.
<img id="img1" runat="server" src="~/images/logo.jpg"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top