Not able to View the Image on the website

Last post 10-29-2007 6:03 PM by Mikhail Arkhipov (MSFT). 5 replies.

Sort Posts:

  • Not able to View the Image on the website

    10-29-2007, 3:12 PM
    • Member
      point Member
    • manukaura
    • Member since 10-29-2007, 7:09 PM
    • Posts 3

    Dear pals,

    I am trying to make a website & i am not able to view the images that i have added in Image, Image Button or Image Map....Also same with the HTML controls

    Cheers

    Manu!!!! 

     

     

    Filed under:
  • Re: Not able to View the Image on the website

    10-29-2007, 3:31 PM
    • All-Star
      32,470 point All-Star
    • augustwind
    • Member since 07-21-2002, 11:16 PM
    • Garland, TX
    • Posts 4,546
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    I'd check the source of the file to see if the path to the images matches up correctly with the file structure.

    However, alternately - - - are you saying that nothing comes up on the screeen when you view it from the website?

    David Wier
    MCP/ASPInsider
    ASPNet101.com - where to look first!
    Replace It! - the newest from August Wind - search/replace in multiple files
    Control Grouper - easily control properties for multiple controls with one control!
    Calendar Express - The Best HTML Calendar Generator on the web!
    (Please 'Mark as Answer' when it applies)
  • Re: Not able to View the Image on the website

    10-29-2007, 5:17 PM

    Can you post actual markup here?

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • Re: Not able to View the Image on the website

    10-29-2007, 5:44 PM
    • Member
      point Member
    • manukaura
    • Member since 10-29-2007, 7:09 PM
    • Posts 3

    The code behind is:

     

    <%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

    <!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>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            &nbsp; &nbsp; &nbsp;
            <img src="file:///C:\Manu%20Kaura\ASP%20Project\Rohit_Website\App_Data\4938409.gif"
                style="left: -35px; position: relative; top: -264px; z-index: 100;" />
            <table style="left: 144px; width: 554px; position: relative; top: 21px; height: 160px">
                <tr>
                    <td style="width: 20px; height: 15px">
                        <img src="file:///C:\Manu%20Kaura\ASP%20Project\Rohit_Website\App_Data\animation_thumb2.gif"
                            style="position: relative" /></td>
                    <td style="width: 100px; height: 15px">
                        <asp:Label ID="Label1" runat="server" Height="70px" Style="font-weight: bold; font-size: 15pt;
                            left: 50px; font-style: normal; position: relative; top: -7px" Text="FOR ADS PLEASE CALL: US (734-983-9020) & INDIA (0771-4270930/4270941)"
                            Width="301px"></asp:Label>
                    </td>
                </tr>
            </table>
            <img src="file:///C:\Manu%20Kaura\ASP%20Project\Rohit_Website\App_Data\Computer-04-june.gif"
                style="left: 529px; width: 165px; position: relative; top: 28px; height: 314px" />
        </form>
    </body>
    </html>

  • Re: Not able to View the Image on the website

    10-29-2007, 5:56 PM
    Answer
    • All-Star
      32,470 point All-Star
    • augustwind
    • Member since 07-21-2002, 11:16 PM
    • Garland, TX
    • Posts 4,546
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Look at your path for the img tag:
    <img src="file:///C:\Manu%20Kaura\ASP%20Project\Rohit_Website\App_Data\Computer-04-june.gif"

    This applies to all of the image tags:

    First - do you really have your images in your App_Data folder?  (if so, I'd recommend moving them from there, to a dedicated images folder)

    After that, then, make the path in the src attribute reflect the relative path from the page to the actual image.

    For instance

    Root (web pages here)
    --Images (imageshere)

    img src="images/Computer-04-june.gif"

    Better yet, use an ASP.Net image control - then, you can choose the image file quickly and directly, with the properties window.

    David Wier
    MCP/ASPInsider
    ASPNet101.com - where to look first!
    Replace It! - the newest from August Wind - search/replace in multiple files
    Control Grouper - easily control properties for multiple controls with one control!
    Calendar Express - The Best HTML Calendar Generator on the web!
    (Please 'Mark as Answer' when it applies)
  • Re: Not able to View the Image on the website

    10-29-2007, 6:03 PM

    You need to add image to the Web site (create Images folder or something). Second, do not specify file:// absolute path. Using absolute paths makes it difficult to publish Web site and may be a security violation so IIS won't access the image.

    Thanks

    ------------------------------------------------------------

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (6 items)