1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

A href and asp prob

Discussion in 'Web Design & Development' started by tallpaul, Jan 29, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. tallpaul

    tallpaul Thread Starter

    Joined:
    Mar 27, 2006
    Messages:
    23
    hi iam trying to pass a variable in the querystring but all it seems to do is pass the querystring and then everything afterthat in the querystring, if anyone could help me please

    this is the line that works ok before i changed anything

    response.Write "<a href=" & rsgallery("piclrge") & ">" & ("<img src=") & rsgallery("picsmall") & " /></td>" & vbnewline

    And this is where i am trying to send a query to a page that has gone wrong

    response.Write "<a href=""gallery.asp?piclrge=" & rsgallery("piclrge") & ">" & ("<img src=") & rsgallery("picsmall") & " />



    Many thanx if anyone can help


    Tall Paul
     
  2. sarei

    sarei

    Joined:
    Dec 13, 2006
    Messages:
    38
    Try this instead:

    response.Write "<a href='gallery.asp?piclrge=" & rsgallery("piclrge") & "'><img src='" & rsgallery("picsmall") & "' />

    my asp is a little rough as I haven't done it in a while but I think that the problem is just having the quotes in there.... hopefully. ;)
     
  3. tallpaul

    tallpaul Thread Starter

    Joined:
    Mar 27, 2006
    Messages:
    23
    i will try this and get back


    cheers


    tall Paul
     
  4. tallpaul

    tallpaul Thread Starter

    Joined:
    Mar 27, 2006
    Messages:
    23
    this is part of the code i am using

    Problem line highlighted

    <table id="gallerypics">
    <% dim i
    dim picsmall
    dim piclrge
    picsmall=rsgallery("picsmall")
    piclrge=rsgallery("piclrge")
    do while not rsgallery.eof
    response.Write vbtab & ("<tr>") & vbnewline
    for i =1 to 4
    response.Write vbtab & vbtab & ("<td>")
    response.Write "<a href='gallery.asp?piclrge=" & rsgallery("piclrge") & "'><img src='" & rsgallery("picsmall") & "' />
    rsgallery.movenext
    if rsgallery.eof then
    i=6
    end if
    next
    response.write vbtab & ("</tr>" & vbnewline)
    loop
    %>
    </table>

    This is the error iam getting

    Microsoft VBScript compilation error '800a0409'

    Unterminated string constant

    /mwmservices/building.asp, line 44

    response.Write "<a href='gallery.asp?piclrge=" & rsgallery("piclrge") & "'><img src='" & rsgallery("picsmall") & "' />
    ----------------------------------------------------------------------------------------------------------^
     
  5. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    The end needs to be enclosed in a double quote.
     
  6. tallpaul

    tallpaul Thread Starter

    Joined:
    Mar 27, 2006
    Messages:
    23
    Thanx for that but i have tried and this is the error that i get now



    This is the error now


    Microsoft VBScript compilation error '800a0409'

    Unterminated string constant

    /mwmservices/building.asp, line 44

    response.Write "<a href='gallery.asp?piclrge=" & rsgallery("piclrge") & "'><img src='" & rsgallery("picsmall") & "' />""
    ------------------------------------------------------------------------------------------------------------^
     
  7. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    Response.Write "<a href= gallery.asp?piclrge=" & rsgallery("piclrge") & "><img src= 'images/" & rsgallery("picsmall") & "'/>"

    Use these tags <%= %> and you won't have to use Response.Write outside of your code blocks.
     
  8. tallpaul

    tallpaul Thread Starter

    Joined:
    Mar 27, 2006
    Messages:
    23
    Thanks rockn you was right the first time, what i did was add 2 double quotes anot one as you said and when i changed it , it worked, many thanks
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/539321

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice