Home All Groups Group Topic Archive Search About

Href with imbedded single quote

Author
26 Feb 2006 2:04 PM
Wayne Wengert
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='YTDDetails1.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?

Author
26 Feb 2006 2:10 PM
Terry Burns
I dont think single quotes in attribute names are legal, my advice is to
avoid them.

--
Terry Burns
http://TrainingOn.net

Show quoteHide quote
"Wayne Wengert" <wayneSKIPSPAM@wengert.org> wrote in message
news:uAIhW2tOGHA.3896@TK2MSFTNGP15.phx.gbl...
>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='YTDDetails1.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?
>
Author
26 Feb 2006 3:29 PM
Cor Ligthert [MVP]
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

Show quoteHide quote
"Wayne Wengert" <wayneSKIPSPAM@wengert.org> schreef in bericht
news:uAIhW2tOGHA.3896@TK2MSFTNGP15.phx.gbl...
>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='YTDDetails1.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?
>
Author
26 Feb 2006 3:47 PM
Wayne Wengert
Good suggestion - I should have thought of that!

Wayne

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OtCXzkuOGHA.2668@tk2msftngp13.phx.gbl...
> 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:uAIhW2tOGHA.3896@TK2MSFTNGP15.phx.gbl...
>>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='YTDDetails1.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?
>>
>
>