User Controls and Image Sources

J

John

I am pulling my hair out regarding how the source URL
should be for images, javascript, etc. when including
user controls in my aspx pages. I am developing sites on
my local machine (XP Pro, IIS 5.0) and can't seem to get
my user controls to appear correctly. All my images are
broken and I get javascript errors because it can't find
the file. This is all due to how I am defining the
source (I believe).

Since my user controls can be used at different levels
within my app, I define the source as
src="/images/image.gif">. The same applies to my
javascript - src="/js/tabpane.js". What I think is
happening is it is looking for these files at the root of
my wwwroot folder. I am using VS.NET 2003 to develop my
sites. Can anyone help me out? Is there a better way
of organizing/setting up my site structure?
 
J

Juno

Hi,

I think you'd better use relative path rather than absolute path. For
example: <img src="../images/image.gif">.


Juno
MCSD.NET, MCDBA, MCSE
 
J

John

I don't think I would be able to do that if the controls
were used in any sub folders, right?
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top