How to get qoutes around variables from a database

Discussion in 'ASP General' started by MasterChief, Nov 2, 2005.

  1. MasterChief

    MasterChief Guest

    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>")
    MasterChief, Nov 2, 2005
    #1
    1. Advertising

  2. MasterChief

    Evertjan. Guest

    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>
    <%



    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
    Evertjan., Nov 2, 2005
    #2
    1. Advertising

  3. MasterChief

    Hal Rosser Guest

    >
    > 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
    Hal Rosser, Nov 3, 2005
    #3
    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. Jason Lehman
    Replies:
    3
    Views:
    417
    Jason Lehman
    Feb 14, 2005
  2. Piet
    Replies:
    0
    Views:
    527
  3. Replies:
    9
    Views:
    939
  4. Network/Software Buyer
    Replies:
    0
    Views:
    414
    Network/Software Buyer
    May 23, 2010
  5. chris

    Double-qoutes problem in CreateChildControls()

    chris, Aug 29, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    204
    Levi Rosol
    Sep 1, 2004
Loading...

Share This Page