Link to home
Start Free TrialLog in
Avatar of PatrickSweeney
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:

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



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?
ASKER CERTIFIED SOLUTION
Avatar of Pratima
Pratima
Flag of India image

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