String Passing

Discussion in 'ASP General' started by HartAch, May 18, 2005.

  1. HartAch

    HartAch Guest

    Having a little problem with this.

    response.write "<A onclick=sendme() target='myNewWin' HREF='filter.asp?ins="
    & insName & "'>"%>Advanced Filter</a>

    I need to have a single quote around insName.

    I tried the following

    Function sIn(s)
    sIn = "'" & Replace(s, "'", "' '") & "'"
    End Function

    sIn(insName)

    but that is not working.

    Please help.

    Thank you
     
    HartAch, May 18, 2005
    #1
    1. Advertising

  2. Why?

    Try working backwards, meaning, just make an HTML page that has what you
    want, eg.

    <a onclick="sendme();" target="myNewWin"
    href="filter.asp?ins='something'">Advanced Filter</a>

    Then, convert to ASP

    <%
    insName = "your value"
    Response.Write "<a onclick=""sendme();"" target=""myNewWin""
    href=""filter.asp?ins='" & insName & "'"">Advanced Filter</a>"
    %>


    Use " to enclose values in tags.

    Ray at work


    "HartAch" <> wrote in message
    news:%...
    > Having a little problem with this.
    >
    > response.write "<A onclick=sendme() target='myNewWin'

    HREF='filter.asp?ins="
    > & insName & "'>"%>Advanced Filter</a>
    >
    > I need to have a single quote around insName.
    >
    > I tried the following
    >
    > Function sIn(s)
    > sIn = "'" & Replace(s, "'", "' '") & "'"
    > End Function
    >
    > sIn(insName)
    >
    > but that is not working.
    >
    > Please help.
    >
    > Thank you
    >
    >
    >
     
    Ray Costanzo [MVP], May 18, 2005
    #2
    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. Victor Bazarov
    Replies:
    25
    Views:
    896
    E. Robert Tisdale
    Mar 23, 2005
  2. pereges
    Replies:
    7
    Views:
    440
    pereges
    Jun 1, 2008
  3. Ramon F Herrera
    Replies:
    8
    Views:
    485
    Pascal J. Bourguignon
    Sep 13, 2009
  4. deadpickle
    Replies:
    1
    Views:
    992
    Jens Thoms Toerring
    Nov 7, 2010
  5. Victor Hooi
    Replies:
    3
    Views:
    117
    Chris Kaynor
    Nov 27, 2013
Loading...

Share This Page