Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When i build a web site with my visual studio in asp.net (when i debug) in the internet explorer 8 ,my images dont load how do i enable them to load?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml"><br />
<head runat="server"><br />
    <title>..::my first webpage::.</title><br />
    <style type="text/css"><br />
        .style1<br />
        {<br />
            width: 59px;<br />
        }<br />
        .style3<br />
        {<br />
            width: 163px;<br />
        }<br />
        .style4<br />
        {<br />
            width: 59px;<br />
            height: 161px;<br />
        }<br />
        .style5<br />
        {<br />
            width: 163px;<br />
            height: 161px;<br />
        }<br />
        .style6<br />
        {<br />
            height: 161px;<br />
        }<br />
        .style7<br />
        {<br />
            width: 178px;<br />
            height: 94px;<br />
        }<br />
    </style><br />
<script language="vbscript" type="text/vbscript"><br />
<br />
</script><br />
</head><br />
<body bgcolor="#006666"><br />
    <form id="form1" runat="server"><br />
    <div><br />
    <br />
    </div><br />
    <table style="width:100%;"><br />
        <tr><br />
            <td class="style4"><br />
                </td><br />
            <td class="style5"><br />
                <asp:Image ID="Image1" runat="server" ImageUrl="~/App_Data/images.jpg" /><br />
            </td><br />
            <td class="style6"><br />
                <img alt="" class="style7" src="" <br />
                    style="background-image: url('App_Data/images.jpg')" /></td><br />
        </tr><br />
        <tr><br />
            <td class="style1"><br />
                <input id="btnClient" type="button" value="Client" style="height: 26px"  onclick="return btnClient_onclick()" /></td><br />
            <td class="style3"><br />
                <asp:Label ID="Label1" runat="server" Text="Client"></asp:Label><br />
            </td><br />
            <td><br />
                &nbsp;</td><br />
        </tr><br />
        <tr><br />
            <td class="style1"><br />
                &nbsp;</td><br />
            <td class="style3"><br />
                &nbsp;</td><br />
            <td><br />
                &nbsp;</td><br />
        </tr><br />
        <tr><br />
            <td class="style1"><br />
                <asp:Button ID="btnServer" runat="server" style="height: 26px" Text="Server" /><br />
            </td><br />
            <td class="style3"><br />
                <asp:Label ID="Label2" runat="server" Text="Server"></asp:Label><br />
            </td><br />
            <td><br />
                &nbsp;</td><br />
        </tr><br />
    </table><br />
    </form><br />
</body><br />
</html><br />
Posted
Updated 20-Jan-10 10:29am
v2

Fix your code. Hard to know what else to say. Are the images in the correct virtual path ? Actually, VS sometimes adds the website name to the path, which can mess up absolute paths, so that could be the issue.

Do they show ANYWHERE ? What makes you feel the paths are right ? How do you think we can tell you if they are, if you keep them a secret ?
 
Share this answer
 
Make sure the image path is relative to the web application.
 
Share this answer
 
Hi there,

There's really quite a few things messed up on your page.

For example; you have a mixture of different relative paths to your images.

'App_Data/images.jpg' & '~/App_Data/images.jpg'

Is the file called images or is that a folder name?

Plus you are not separating style and content properly which is really poor practice.

It looks like you are just beginning to learn so my advice is to take it slow and learn how to do it properly.

There are some fantastic resources here.http://www.asp.net/learn/[^]

Go through them from the start and you will soon pick up a lot of skills.

If you get stuck, don't be afraid to ask. Not everyone will just insult you. Just try to be consise with your query.

Oh and try to learn C# as early as possible. The syntax is a bit awkward at first but it is a well structured language and much closer to other languages like javascript than VB.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900