Currently, I have a JavaScript function that is being called using the following code:
<a href='javascript:void(0)' onclick='javascript:onEditRevPrepare(" <%#Convert.ToString(Eval("ReviewTitle"))%>">
The issue arises when the Eval("ReviewTitle")
contains a single quote or double quote, causing the function to not execute properly.
I suspect that the problem lies in this line of code:
Convert.Tostring(....)
However, I still need to convert it into a string before passing it to the JavaScript function.
How can I resolve this issue?
This is the JavaScript function in question:
function onEditRevPrepare(revTitle)
{
...
...
}