How to get qoutes around variables from a database

M

MasterChief

I have the following statement in ASP. I was wondering how to get
qoutes around the variables like DocLink and DocName. Is it only
possible to get single tick marks instead of regular qoutes?

Response.Write("<a class=""MenuLinks"" href=" &
Rs.Fields("DocLink").value & "target=""_blank"">" &
Rs.Fields("DocName").value & "</a>")
 
E

Evertjan.

MasterChief wrote on 02 nov 2005 in
microsoft.public.inetserver.asp.general:
I have the following statement in ASP. I was wondering how to get
qoutes around the variables like DocLink and DocName. Is it only
possible to get single tick marks instead of regular qoutes?

Response.Write("<a class=""MenuLinks"" href=" &

no () necessary in VBS, they just are an extra parsing cicle.
Rs.Fields("DocLink").value & "target=""_blank"">" &

"target ==> " target
Rs.Fields("DocName").value & "</a>")

1:

Response.Write "<a class=""MenuLinks"" href=""" &_
Rs.Fields("DocLink").value & """ target=""_blank"">" &_
Rs.Fields("DocName").value & "</a>"

2:

Response.Write "<a class='MenuLinks' href='" &_
Rs.Fields("DocLink").value & "' target='_blank'>" &_
Rs.Fields("DocName").value & "</a>"

3:

%>
<a class='MenuLinks'
href='<% =Rs.Fields("DocLink").value %>'
target='_blank'>
<% =Rs.Fields("DocLink").value %>
</a>
<%
 
H

Hal Rosser

Response.Write("<a class=""MenuLinks"" href=" &
Rs.Fields("DocLink").value & "target=""_blank"">" &
Rs.Fields("DocName").value & "</a>")
I believe you just double-up the quotes - like this:

Dim strMsg
strMsg = "He said ""Howdy"", but he didn't mean it."

Now the word Howdy contains quotes aroun it in the string.

HTH
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top