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 undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Your help has saved me hundreds of hours of internet surfing.