Link to home
Start Free TrialLog in
Avatar of samelamin
samelamin

asked on

ASP.NET images showing on IE but not firefox

Hey all
I am getting a really weird error,i am trying to show a logo on my web application and for some reason the logo is shown on IE but not forefox or chrome

whats weird is that if i click on open new window on chrome it shows it

after research people suggested i should use forward slashes instead of back slashes but that hasnt worked

i should say that i am using responce.write to create the image

   Response.Write("<img src=\\\\ATL-WINDOWS1\\c$\\logo\\logo.jpg alt=Altman Technologies Logo border=0 class=logo> <br>");
Avatar of Jarrod
Jarrod
Flag of South Africa image

try

Response.Write("<img src=\\ATL-WINDOWS1\\c$\\logo\\logo.jpg alt=Altman Technologies Logo border=0 class=logo> <br>");

Open in new window

You are referencing an image on a Windows Network (\\server\dir\dir...), this works in IE but not in Firefox.

I suggest you include the image in a sub-directory on the site. I would recommend you add an "~/img" directory, then add the logo inside that directory.

You can then reference it like this:

Response.Write("<img src=/img/logo.jpg alt=Altman Technologies Logo border=0 class=logo> <br>");
Avatar of samelamin
samelamin

ASKER

what exactly do you mean robasta
so create a directory in my main webapplication and insert a logo in it

what i did it is i created a logo directory and inserted a logo in it
heres the call
 Response.Write("<img src=~/logo/logo.jpg alt=Altman Technologies Logo border=0 class=logo> <br>");
but its still no working
remove the tilde (~)

i did that as well
nothing yet mate
whats really strange is that if i reference it on the windows network it wont appear on google chrome

but when i open it on a new tab the image is shown
ASKER CERTIFIED SOLUTION
Avatar of robasta
robasta
Flag of Zimbabwe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes thats the file structure
yes i do it works on visual studio when i run it on google

and yes i do have a doctype decleration
try this one:

Response.Write("<img src='/img/img2/logo.jpg' alt='Rob Technologies Logo' border='0' class='logo'> <br>");
nope that doesnt work either
it doesnt even work on IE
i should say that i created the img and img2 directory
post your code, so i can go through it
here is the generic error page
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GenericErrorPage.aspx.cs" Inherits="Webstation.GenericErrorPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>
    
   
</title>
</head>
<body>
    <form id="form1" runat="server">
      <asp:Image ID="Logo"
runat="server"
AlternateText="Logo"
ImageUrl="\\ATL-WINDOWS1\c$\logo\logo.jpg"/>

    <div>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    <br />
   <asp:LinkButton ID="LinkButton2" Font-Size=10 Font-Names=verdana runat="server" 
         onclick="LinkButton2_Click">Job Details</asp:LinkButton>
    
     &nbsp;
      
   <asp:LinkButton ID="LinkButton3" Font-Size=10 Font-Names=verdana runat="server" 
         onclick="LinkButton3_Click">Upload Client</asp:LinkButton>
    
    <br />
    

    <br />
  
    
     <asp:LinkButton ID="LinkButton1" Font-Size=10 Font-Names=verdana runat="server" 
         onclick="LinkButton1_Click">Logout</asp:LinkButton>

 <br />
   © Altman Technologies Ltd - 2009
    </form>

</body>
</html>

    </div>
    </form>
</body>
</html>

Open in new window

<asp:Image ID="Logo"
runat="server"
AlternateText="Logo"
ImageUrl="\\ATL-WINDOWS1\c$\logo\logo.jpg"/>


should be:

 <asp:Image ID="Logo"
runat="server"
AlternateText="Logo"
ImageUrl="~/logo/logo.jpg"/>
it still isnt showing
when i open it in a new tab
http://172.21.2.5:82/logo/logo.jpg

this is the address that is produced
Is your page on this location :

http://172.21.2.5:82/GenericErrorPage.aspx
yup thats right
Can you view the image in the Designer?
--from the <asp:Image...> control
yes i can
That means you should be able to view the image in IE.  Which browsers are not showing the images now?

Run the page and show the markup that is generated.
it runs in IE but not Google Chrome and firefox
In Firefox/Chrome, Run the page, press CNTRL+U, then post the code here
here
<font size=2 face=Verdana>Welcome to Altman Technologies.<BR><script> alert('Error 7. Error. Please Contact your network administrator');</script> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head><title> 
	
    
   
 
</title></head> 
<body> 
    <form name="form1" method="post" action="GenericErrorPage.aspx" id="form1"> 
<div> 
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> 
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> 
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjI1NTg2OTgxZGTrzPhbWkf2EVTSqOR4CeRY+TruZg==" /> 
</div> 
 
<script type="text/javascript"> 
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script> 
 
 
<div> 
 
	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBALK7aG5BAKxi96RBQKWosD8CgLM9PumD9QoG6xO4mqNecYl4c7DJ3XSx94D" /> 
</div> 
       <img id="Logo" src="logo/logo.jpg" alt="Logo" style="border-width:0px;" /> 
      <br /> 
      <br /> 
 
    <div> 
         <br /> 
   <a id="LinkButton2" href="javascript:__doPostBack('LinkButton2','')" style="font-family:verdana;font-size:10pt;">Job Details</a> 
    
     &nbsp;
      
   <a id="LinkButton3" href="javascript:__doPostBack('LinkButton3','')" style="font-family:verdana;font-size:10pt;">Upload Client</a> 
    
    <br /> 
    
 
    <br /> 
  
    
     <a id="LinkButton1" href="javascript:__doPostBack('LinkButton1','')" style="font-family:verdana;font-size:10pt;">Logout</a> 
 
 <br /> 
   © Altman Technologies Ltd - 2009
    </form> 
 
</body> 
</html> 
 
    </div> 
    </form> 
</body> 
</html>

Open in new window

This code runs as expected in my Firefrox and Chrome.

Then, it should be that your browsers are not displaying images (check your settings or try a site with images in FF/Chrome)
but they are showing images everywhere
this is very strange
ok thanks for your help anyways
Is this page on the net by any chance?
no i am hosting it on my DCs IIS
What is the image src value on the rendered page where the image is not shown
I have solved it by creating the image on the applications folder

thank u all for your help