String concact problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C

    #1

    String concact problem

    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.FindCont rol("LBtnEmailD oc")
    varControl.Attr ibutes.Add("onc lick", "openOutlook('\ \\\" &
    strNewFile & "')")


  • =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=

    #2
    RE: String concact problem

    Howdy,

    varControl = e.Item.FindCont rol("LBtnEmailD oc")
    varControl.Attr ibutes.Add("onc lick", "openOutlook('\ \\\" &
    strNewFile.Repl ace("'", "\'") & "')")

    HTH
    --
    Milosz


    "David C" wrote:
    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.FindCont rol("LBtnEmailD oc")
    varControl.Attr ibutes.Add("onc lick", "openOutlook('\ \\\" &
    strNewFile & "')")
    >
    >
    >

    Comment

    Working...