Or an easier way than using chr(), this :-
Response.write "<img src=""orchidsgold/" & rs("pic_name") & """ alt="""
& rs("desc") & """>"
Which escapes the quotes by doubling them up.
Dan
-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 08 August 2005 23:04
To: [email protected]
Subject: Re: [ASP] need help with an alt tag
Try this.....
Response.Write "<img src=" & chr(34) & "orchidsgold/" & rs("pic_name") &
chr(34) & " alt=" & chr(34) & Server.HTMLEncode(rs("desc")) & chr(34) &
">"
Soren
http://www.MegaCoolStuff.com
Darth Mikey D <[EMAIL PROTECTED]>
Sent by: [email protected]
08/08/2005 04:10
Please respond to active-server-pages
To: [email protected]
cc:
Subject: [ASP] need help with an alt tag
I am trying to populate an images alt tag with info from a database, but
when I do it, it just displays the first word, not the entire sentence.
I tried looking at the source, and the entire sentence is there, just
not being displayed. Here is my code. any help would be appreciated.
desc = rs("desc")
<img src=orchidsgold/" & rs("pic_name") & " alt=" & desc & ">
I also tried this, but had the same problem:
<img src=orchidsgold/" & rs("pic_name") & " alt=" & rs("desc") & ">
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
[Non-text portions of this message have been removed]
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
<font face=arial size=-1><a
href="http://us.ard.yahoo.com/SIG=12hv4007a/M=362335.6886445.7839731.1510227/D=groups/S=1705115381:TM/Y=YAHOO/EXP=1123591176/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/">In
low income neighborhoods, 84% do not own computers. At Network for Good, help
bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~->
---------------------------------------------------------------------
Home : http://groups.yahoo.com/group/active-server-pages
---------------------------------------------------------------------
Post : [email protected]
Subscribe : [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
---------------------------------------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/active-server-pages/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/