invoking javascript on a click of label
<p>I have a gridview and inside the gridview, I have a label and when the user clicks on that label, I invoke a javascript function. I passw few values from that label to javascript function. If the values has apsotrphe in it. It generates an error and does not invke javascript function. Below is my code.</p>

<pre><code>&lt;asp:TemplateField&gt; 
    &lt;ItemTemplate&gt; 
        &lt;label style="text-decoration: underline" onclick="javascript:GetSelectedRow('&lt;%# Eval("ID") %&gt;','&lt;%# Eval("systempath") %&gt;','','',1);"&gt;&lt;%#Eval("ID") %&gt;&lt;/label&gt; 
    &lt;/ItemTemplate&gt; 
&lt;/asp:TemplateField&gt;
</code></pre>

<p>and the javascript function is</p>

<pre><code>function GetSelectedRow(id, systempath, x, x, rowIndex) { 

    debugger; 
    var label = document.getElementById('&lt;%=lbl_ID.ClientID %&gt;'); 

    label.innerText = mclid + "|" + systempath; 
    document.getElementById('&lt;%=hdnlblID.ClientID %&gt;').value = id + "|" + systempath; 

    return false; 

}
</code></pre>
