Href with imbedded single quote

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wayne Wengert

    #1

    Href with imbedded single quote

    I am trying to build a list of href statements that include parameters as in
    the following code:

    Response.Write( "<td align='center'> <a href='YTDDetail s1.asp?jname=" &
    aryRslt(0,i) & "&jclass=" & ColList(j+1) & "'>" & aryRslt(j,i) & "</a>")

    The value of the aryRslt(0,i) is names that can include a single quote (e.g.
    "O'Brien") and that truncates the statement. How should I code this to
    accomodate that?


  • Terry Burns

    #2
    Re: Href with imbedded single quote

    I dont think single quotes in attribute names are legal, my advice is to
    avoid them.

    --
    Terry Burns


    "Wayne Wengert" <wayneSKIPSPAM@ wengert.org> wrote in message
    news:uAIhW2tOGH A.3896@TK2MSFTN GP15.phx.gbl...[color=blue]
    >I am trying to build a list of href statements that include parameters as
    >in the following code:
    >
    > Response.Write( "<td align='center'> <a href='YTDDetail s1.asp?jname=" &
    > aryRslt(0,i) & "&jclass=" & ColList(j+1) & "'>" & aryRslt(j,i) & "</a>")
    >
    > The value of the aryRslt(0,i) is names that can include a single quote
    > (e.g. "O'Brien") and that truncates the statement. How should I code this
    > to accomodate that?
    >[/color]


    Comment

    • Cor Ligthert [MVP]

      #3
      Re: Href with imbedded single quote

      Wayne,

      I would look what the UrlEncode method could do for me in your place.

      http://msdn2.microsoft.com/en-us/library/s2x4538s.aspx

      I hope this helps,

      Cor

      "Wayne Wengert" <wayneSKIPSPAM@ wengert.org> schreef in bericht
      news:uAIhW2tOGH A.3896@TK2MSFTN GP15.phx.gbl...[color=blue]
      >I am trying to build a list of href statements that include parameters as
      >in the following code:
      >
      > Response.Write( "<td align='center'> <a href='YTDDetail s1.asp?jname=" &
      > aryRslt(0,i) & "&jclass=" & ColList(j+1) & "'>" & aryRslt(j,i) & "</a>")
      >
      > The value of the aryRslt(0,i) is names that can include a single quote
      > (e.g. "O'Brien") and that truncates the statement. How should I code this
      > to accomodate that?
      >[/color]


      Comment

      • Wayne Wengert

        #4
        Re: Href with imbedded single quote

        Good suggestion - I should have thought of that!

        Wayne

        "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
        news:OtCXzkuOGH A.2668@tk2msftn gp13.phx.gbl...[color=blue]
        > Wayne,
        >
        > I would look what the UrlEncode method could do for me in your place.
        >
        > http://msdn2.microsoft.com/en-us/library/s2x4538s.aspx
        >
        > I hope this helps,
        >
        > Cor
        >
        > "Wayne Wengert" <wayneSKIPSPAM@ wengert.org> schreef in bericht
        > news:uAIhW2tOGH A.3896@TK2MSFTN GP15.phx.gbl...[color=green]
        >>I am trying to build a list of href statements that include parameters as
        >>in the following code:
        >>
        >> Response.Write( "<td align='center'> <a href='YTDDetail s1.asp?jname=" &
        >> aryRslt(0,i) & "&jclass=" & ColList(j+1) & "'>" & aryRslt(j,i) & "</a>")
        >>
        >> The value of the aryRslt(0,i) is names that can include a single quote
        >> (e.g. "O'Brien") and that truncates the statement. How should I code this
        >> to accomodate that?
        >>[/color]
        >
        >[/color]


        Comment

        Working...