Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

String concact problem

1 view
Skip to first unread message

David C

unread,
May 9, 2008, 5:29:55 PM5/9/08
to
I have an asp.net page that is adding a javascript onclick event by adding
an attribute (see below). The problem is that when the file name (shown as
strNewFile) has a single quote in the name (e.g. David's Document.doc) then
the javascript function fails. I assume it is a string concat problem but
have been unable to solve it. Any help is appreciated.

David

varControl = e.Item.FindControl("LBtnEmailDoc")
varControl.Attributes.Add("onclick", "openOutlook('\\\\" &
strNewFile & "')")


Milosz Skalecki [MCAD]

unread,
May 9, 2008, 6:44:02 PM5/9/08
to
Howdy,

varControl = e.Item.FindControl("LBtnEmailDoc")
varControl.Attributes.Add("onclick", "openOutlook('\\\\" &

strNewFile.Replace("'", "\'") & "')")

HTH
--
Milosz

0 new messages