Link to home
Start Free TrialLog in
Avatar of PatrickSweeney

asked on

handling ' in javascript popup

Using .NET 2.0 with VB.NET
In a gridview, if you click the customer name, a popup window appears with a detailsview for the full customer details.
This is accomplished with the following code:

                        <a href="javascript:openPopup('details1.aspx?id=<%# Eval("ID") %>&bsm=<%# Eval("sales_dev") %>')"><%#Eval("customer_name")%></a>&nbsp;

The bsm parameter represents the person responsible for the lead.
The problem is that some of the people have apostrophes in their names. In this case the javascript string is truncated and the window does not open.
I know that apostrophes in javascript can be escaped by prefixing them with a backslash.
How would I get the backslash into the link?
Avatar of Pratima
Flag of India image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial