How to find ClientId in aspx(javascript) that the control is in the template
<pre><code>        function CheckRequired(target, value) {
        if ($("#&lt;%=rbWaiveyes.ClientId %&gt;").attr("checked") || $("#&lt;%=rvWaiveno.ClientId %&gt;").attr("checked")) {
            value.IsValid = true;
        } else {
            value.IsValid = false;
        }
    }
</code></pre>

<p>I want to get rbWaiveyes and rvWaiveno ID, the script works in ordinary way.
but the rbWaiveyes  and rvWaiveno  are actually in the template of gridview.
what we do in the c# file is that we can use findcontrol method, but how can i find id in the aspx(javascript) way.</p>

<p>And the this is actually custom validater control which is also put in the template, so call is also from template.</p>
