M
Mel
I have the following lines of code in the GridView.RowDataBound event
to call some Javascript code when the user clicks on a GridView row.
If any of the strings I am passing to the Javascript code contain a
single quote this Javascript error occurs: Error: Expected ')'. How
do I fix the first line of code below to allow for single quotes?
seldata = "userSelected('" + strCustName + "','" + strCustCompany +
"', '" + strAddress + "')"
e.Row.Attributes.Add("onclick", seldata)
'test the code above by setting strAddress = "123 Veteran's Blvd"
(using asp.net 2.0, vb.net, VS2008)
to call some Javascript code when the user clicks on a GridView row.
If any of the strings I am passing to the Javascript code contain a
single quote this Javascript error occurs: Error: Expected ')'. How
do I fix the first line of code below to allow for single quotes?
seldata = "userSelected('" + strCustName + "','" + strCustCompany +
"', '" + strAddress + "')"
e.Row.Attributes.Add("onclick", seldata)
'test the code above by setting strAddress = "123 Veteran's Blvd"
(using asp.net 2.0, vb.net, VS2008)