Images on server.

R

rcoco

Hi all,
I'm facing this problem I have images on my website but when I Deploye
the website on server the Images are not there I only get the X sign.
How can I go about this.
Thanks
 
M

Mark Rae

I'm facing this problem I have images on my website but when I Deploye
the website on server the Images are not there I only get the X sign.
How can I go about this.

By making sure that the images are where the rest of the app is expecting to
find them...

Why are they not there...? Have you forgotten to deploy them to the
website...? Are you using absolute addressing when you should be using
relative addressing...?
 
H

Hans Kesting

rcoco said:
By making sure that the images are where the rest of the app is
expecting to find them...

Why are they not there...? Have you forgotten to deploy them to the
website...? Are you using absolute addressing when you should be using
relative addressing...?

And to test this, see the properties of such a failed image (or find it in
the
html-source of the page in the browser). Is the URL what you expect it to
be? Are the images really where that URL is pointing to?

Hans Kestin
 
R

rcoco

And to test this, see the properties of such a failed image (or find it in
the
html-source of the page in the browser). Is the URL what you expect it to
be? Are the images really where that URL is pointing to?

Hans Kesting

Thanks Hans,
I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?
Thanks.
 
M

Mark Rae

I have managed to see it on The server But when I try getting the
website on The Client I can't see Images. what could i do?

Ah... you surely haven't hardcoded the full filespec of the image files,
have you...?

E.g. <img src="C:\Inetpub\wwwroot\MyProject\images\logo.jpg" />
 
R

rcoco

Ah... you surely haven't hardcoded the full filespec of the image files,
have you...?

E.g. <img src="C:\Inetpub\wwwroot\MyProject\images\logo.jpg" />

Thanks,
Is it any different? I'm using ImageUrl.
ImageUrl="file:///C:\Inetpub\wwwroot\MyProject\Images\logo.JPG "
Thanks
 
M

Mark Rae

Thanks,
Is it any different? I'm using ImageUrl.
ImageUrl="file:///C:\Inetpub\wwwroot\MyProject\Images\logo.JPG "

It's the same thing - this is never going to work...

Use relative addressing for all your images.
 
R

rcoco

Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.
 
R

rcoco

Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.
 
G

Guest

Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.

If MyProject is a name of the virtual root, you can represent it (the
root path) with a tilda (~) character.

~/Images/logo.JPG

If the web form is located in C:\Inetpub\wwwroot\MyProject\

you can use

Images/logo.JPG
 
R

rcoco

thanks,
I have just tried it but it ain't working this is how I've just tried
it: ImageUrl="file:///C:\Inetpub\wwwroot\Images\logo.JPG".
Thanks.
 
M

Mark Rae

Rocco,
I have just tried it but it ain't working this is how I've just tried
it: ImageUrl="file:///C:\Inetpub\wwwroot\Images\logo.JPG".

You cannot hard-code the absolute path like this!!!

Not sure why you seem to be finding this so difficult to understand...

Imagine your site has the following structure (FORGET TOTALLY ABOUT
C:\Inetpub\wwwroot !!!)

<root>
\bin
\Properties
\References
\Folder1
File1.aspx
File2.aspx
\Folder2
File3.aspx
File4.aspx
\images
logo.jpg
\master
default.master
default.aspx
Global.asax
web.config

You are editing \Folder1\File1.aspx and want to include a link to your
logo - do this:

ImageUrl="../images/logo.jpg"

or

ImageUrl="~/images/logo.jpg"
 
R

rcoco

Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.
 
M

Mark Rae

It says: <img id="Logo2" src="../Images/logo.JPG".

Cool! Now we're getting somewhere - you're finally using relative
addressing - hurrah!

So, is the above source actually correct relative to the folder that the
ASPX is in...?
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top