This might be a JavaScript problem, but I'm not sure, so I'm taking a bet on those who know ASP.NET, know JavaScript too....
I'm calling a javascript function that has apostrophes in the arguement strings:
Of course in this example, I could escape the ', toCode:<a href="JavaScript:alert('Mervyn's');">Mervyn's</a><br>
but of course the problem isn't that simple. I'm databinding the arguement like this:Code:alert('Mervyn\ 's') //without the space, of course
This doesn't work when there's an apostrophe in the store name. It seems that there would be a way around this, but I haven't figured it out yet. How can I make sure apostrophe's in StoreName don't break my code?Code:<a href="JavaScript:alert('<%#DataBinder.Eval (Container.DataItem, "StoreName")%>');"> <%#DataBinder.Eval(Container.DataItem, "StoreName")%> </a>
Thanks.


Reply With Quote