Images on server.

  • Thread starter Thread starter rcoco
  • Start date Start date
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
 
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...?
 
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
 
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.
 
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" />
 
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
 
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.
 
Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.
 
Hi Mark,
Could you please help me and show a simple example how to use relative
addressing?
Thank you.
 
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
 
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.
 
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"
 
Thanks Ray,
When I did this:ImageUrl="../Images/logo.JPG", Even on serverside
cannot see the image.
Thanks.
 
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...?
 
Back
Top