Directory struture

  • Thread starter Thread starter Zeba
  • Start date Start date
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
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 !
 
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
 
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 anyone knows any good links for referencing / directory structure
etc. can pls help
Thanks !
 
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"/>
 
Back
Top