Two things:
1. Use Chr(34) to put quotes around the href.
2. Use Server.UrlEncode to encode the link.
like this:
Response.Write("<td align=center><a
href="&Chr(34)&"companycontacts.asp?Company=" &
Server.UrlEncode(rstContacts(1).Value)&Chr(34)&
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")
If rst may contain nulls, then put urlencode into a function like this:
Function PrintEncoded(strValue)
If IsNull(strValue) Then
PrintEncoded = ""
Else
PrintEncoded = Server.UrlEncode(strValue)
End If
End Function
UrlEncode will give an error if it is given a null value.
Shailesh.
Mark Sippitt wrote:
I have a problem with the following code :
Response.write rstContacts(1).Value
The above line prints "Andark Marine"
However the following only passes "Andark" and stops at
the space. How do I get over this ? Its the same with all
records.
Response.Write("<td align=center><a
ref=companycontacts.asp?Company=" & rstContacts(1).Value
& " target=_new><img src=images\contact.ico width=25
height=25 border=0></a></td>")
Thanks for our help
Mark