ASP to display image rather than text path ??

Discussion in 'ASP General' started by david@scene-double.co.uk, Aug 16, 2005.

  1. Guest

    Hi,

    I have asp pages running from a MySQL database.
    I have placed a path in the required field (although not quite sure on
    the correct format).

    My asp page is just displaying the text path instead of the image.
    I'm using response.write.

    The Folder is called : images
    This folder is within : wwwroot\works\images\image1.jpg

    How should I display this in the MySQL field ?
    I have the field as type: VarChar

    How do I display image1.jpg on my asp page ?

    Appreciate your help

    Thanks

    David Gordon
    , Aug 16, 2005
    #1
    1. Advertising

  2. Well, the image path *on the web* is probably /works/images/image1.jpg, so
    that is what you should enter.

    Now, I don't know exactly how you're retrieving this value from MySQL into
    your ASP page, but once you have the value, you just say:

    <img src="<%=imgPath%>">

    Hopefully you see why this will not work if the imgPath =
    wwwroot\works\images\image1.jpg





    <> wrote in message
    news:...
    > Hi,
    >
    > I have asp pages running from a MySQL database.
    > I have placed a path in the required field (although not quite sure on
    > the correct format).
    >
    > My asp page is just displaying the text path instead of the image.
    > I'm using response.write.
    >
    > The Folder is called : images
    > This folder is within : wwwroot\works\images\image1.jpg
    >
    > How should I display this in the MySQL field ?
    > I have the field as type: VarChar
    >
    > How do I display image1.jpg on my asp page ?
    >
    > Appreciate your help
    >
    > Thanks
    >
    > David Gordon
    >
    Aaron Bertrand [SQL Server MVP], Aug 16, 2005
    #2
    1. Advertising

  3. wrote:
    > Hi,
    >
    > I have asp pages running from a MySQL database.
    > I have placed a path in the required field (although not quite sure on
    > the correct format).


    It should be a url to the file.

    >
    > My asp page is just displaying the text path instead of the image.
    > I'm using response.write.
    >
    > The Folder is called : images
    > This folder is within : wwwroot\works\images\image1.jpg
    >
    > How should I display this in the MySQL field ?
    > I have the field as type: VarChar
    >
    > How do I display image1.jpg on my asp page ?
    >
    > Appreciate your help
    >
    > Thanks
    >
    > David Gordon


    <%
    dim img
    img=<content of recordset field>
    %>
    <html>
    <body>
    <IMG src="<%=img%>">
    </body>
    </html>


    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Aug 16, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. darrel
    Replies:
    4
    Views:
    15,693
    darrel
    May 4, 2004
  2. Iain
    Replies:
    0
    Views:
    329
  3. mark4asp
    Replies:
    8
    Views:
    6,634
    Andy Dingley
    Mar 17, 2008
  4. Surendra

    Dropdown control that displays images rather than text?

    Surendra, Mar 28, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    129
  5. fb
    Replies:
    2
    Views:
    115
Loading...

Share This Page