Broken links to graphics

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks in advance for the help and let me know if this should be posted to
another MSDN.

I am developing a web-based application in VS.NET2003 using VB. When I
insert a graphic into a project page it shows just fine in design mode.
However, when I run the app in debug or directly from a browser all the
graphic links in the app show they are broken. Checking the properties shows
that they are pointing to the correct folder. I'm not sure if this is a
directory security issue or a development environment issues. Any help would
be appreciated.
 
John,

When you point them directly to your hard disk that will happens, you have
to point them virtually to your webfolder that holds the reference to that
actual folder.

Can that be the problem?

Cor
 
Cor,
Thanks. I also figured that was the problem and checked it, but as far as I
can tell it is not. Code reads:
<asp:Image id="Image1" runat="server" ImageUrl= "../images/fleet10.jpg">
</asp:Image>
Note the "../images" part. This has always seemed to work in the past but
it decided to stop working about a week ago. Deleting and re-entering the
image has not worked. Creating a new project and importing the content from
this project has not worked. Existing projects where it worked have also
stopped (without changes to the project). Cursing has also not worked:)
I also have pop-up help windows in the apps that are hooked to an image.
The links can't "see" the "../help" folder either. Very curious!!
John Masciantoni
 
Since you are using a server control <asp:Image>, try using '~'.

<asp:Image id="Image1" runat="server" ImageUrl=
"~/images/fleet10.jpg"></asp:Image>

HTH,
Greg
 
Greg,
Thanks. Tried it but it did not solve the issue. I think the core of this
is that it worked as is a week or so ago and now will not. I can't think of
and intentional changes I've made on the dev box that would impact this. In
short, response redirects to pages in subfolders of the project are found.
HTML links, however, are not.
 
John,

For me this sounds as a security isue, you are sure you did not change
something in the IIS settings or loaded some extra security sofware
meanwhile or did something else to security settings?

Cor
 
Just throwing this out there...

You have not disabled images in IE options have you? (Of course you would
see this while surfing the interent also).

Is the images folder under your virtual directory?

something like:

c:\inetpub\wwwroot\<virdir>\images

Greg
 
I think Windows Update broke it.

I have a similar problem with a dialog shown from a web page. It's all html
and script though, no ASP.

Follow the link to my Nothing page and click the underscored here for the
premium version. That dialog used to show an icon and still does when I load
it from my hard drive.

I even tried updating the page so that it loads the image via script exactly
the same way as all the images on my other pages do, but no joy, and I know
the script works since I use it on my other pages.

OnBlur seems to be broken aswell. If the dialog loses focus then the buttons
will no longer respond to clicks, but I'm not 100% sure that that worked
before. I originally used ShowDialog(), but Netscape doesn't like that.
 
I noticed in the status bar of your dialog box the address has a different
domain. Is that expected?

Greg

"Mick Doherty"
 
Yes, I have Frame Redirection in place (cheap option for a hobby site) and
the icon always used to show until just recently, even after XP SP2 was
installed and a statusbar was forced upon my dialog.
 
John said:
all the graphic links in the app show they are broken.

Try checking your web logs (c:\windows\system32\logfiles) to see what the
error is when the browser requests the images. If it's a 404 then the
browser can't find them. If it's a 403 or 401 then it is a permissions
problem with IIS and / or the underlying filesystem.

If it's the former then see if you can access the images directly, e.g.
right-click on the broken placeholder for the image ans select properties,
then copy and paste the url (e.g. http://localhost/virtdir/images/image.gif)
into your browser and see if it works. If it's the latter then make sure the
IUSR_machinename account has access to the images directory.
 
and for my final attempt... I removed the <img> tag and set the background
image in my style sheet. Same problem.
I did find that when run locally, if I set the image to target the copy on
my hard drive then it will show, but if I set it to target the image at a
html address, it does not. I can access the image in a webpage, but not in a
dialog and it's this failure to access the image that is causing the buttons
to stop responding after OnBlur.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


"Mick Doherty"
 
Looks like a problem with the cookieless mode.

Not familiar with it but it could perhaps do that only when trying to access
a protected dir ???

Patrice
 
New Information:
When I publish the site to the live server then the links work.
The links do not work on the development server.
I didn't change any security that I know of but that certainly seems to be
the problem.
I don't know what to change since I didn't change anything to begin with.
Thanks to all for you input.
 
John said:
New Information:
When I publish the site to the live server then the links work.
The links do not work on the development server.
I didn't change any security that I know of but that certainly seems
to be the problem.
I don't know what to change since I didn't change anything to begin
with. Thanks to all for you input.

Looks like everyone beat me to the responses!

Is the development server your local machine? Do you write the pages on your
machine (the development machine) and then use Copy Project to upload to the
live server? Looks like cookieless mode isn't working on your dev machine
properly.
 
Back
Top