setting img size

Discussion in 'ASP General' started by carmen, Dec 27, 2004.

  1. carmen

    carmen Guest

    I need to set the image size in the following line. When I try to set the
    img to 75x75 I am getting an error. The line I'm having problems with is :

    Response.Write "<a href='" & imageFilePath & strPicArray(0,x) & "'><img
    src='" & thumbFilePath & strPicArray(0,x) & "'width="75" height="75"></a>"

    Thanks
    C
     
    carmen, Dec 27, 2004
    #1
    1. Advertising

  2. It's often helpful to tell us what the error is. Luckily, in this post,
    it's easy enough to guess that the error probably mentions something about
    an expected end of statement.

    The problem is that you're trying to put " characters in a string, that is
    begun and ended with the " character (width and height attributes). So, how
    is the server supposed to know when a " means that you want to write a " and
    when a " means that it's the beginning or end of the argument you're passing
    to response.write?

    The way to "escape" the " character when using VBScript is by doubling it
    up.

    Response.Write "<a href='" & imageFilePath & strPicArray(0,x) & "'><img
    src='" & thumbFilePath & strPicArray(0,x) & "'width=""75""
    height=""75""></a>"

    Also, I suggest you not use ' for your attribute values. That's just the
    lazy way out that people like to use. I suggest one of these two lines:

    1.
    <%
    Response.Write "<a href=""" & imageFilePath & strPicArray(0,x) & """><img
    src=""" & thumbFilePath & strPicArray(0,x) & """ width=""75""
    height=""75""></a>"
    %>

    2.
    %>
    <a href="<%=imageFilePath & strPicArray(0,x)%>"><img src="<%=thumbFilePath &
    strPicArray(0,x)%>" width="75" height="75" /></a>

    Ray at work




    "carmen" <carmen@iyahoo_Spam.com> wrote in message
    news:...
    > I need to set the image size in the following line. When I try to set the
    > img to 75x75 I am getting an error. The line I'm having problems with is :
    >
    > Response.Write "<a href='" & imageFilePath & strPicArray(0,x) & "'><img
    > src='" & thumbFilePath & strPicArray(0,x) & "'width="75" height="75"></a>"
    >
    > Thanks
    > C
    >
    >
     
    Ray Costanzo [MVP], Dec 27, 2004
    #2
    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. news.austin.rr.com

    how to download img from html img tag

    news.austin.rr.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    512
    Steve C. Orr [MVP, MCSD]
    Apr 27, 2005
  2. Philipp Lenssen

    Problem: <img></img>

    Philipp Lenssen, Jun 27, 2005, in forum: XML
    Replies:
    15
    Views:
    766
    David Håsäther
    Jul 3, 2005
  3. Jopek
    Replies:
    7
    Views:
    403
    dorayme
    Apr 26, 2009
  4. Replies:
    7
    Views:
    181
    Tad McClellan
    Jun 22, 2006
  5. jodleren

    Getting picture size/setting window size

    jodleren, Feb 14, 2007, in forum: Javascript
    Replies:
    2
    Views:
    159
    jodleren
    Feb 15, 2007
Loading...

Share This Page