How can I pass server side asp control’s client ID in javascript function.
I tried like this.
<asp:RadioButtonList ID="rdbMyocardial" runat="server" RepeatDirection="Horizontal" onClick="return f1('<%rdbMyocardial.ClientID %>')">
<asp:ListItem Value="True">Yes</asp:ListItem>
<asp:ListItem Value="False">No</asp:ListItem>
</asp:RadioButtonList>
But when I try to print the value in javascript, like this,
function f1(list) {
alert(list);
return true;
}
It shows <%rdbMyocardial.ClientID %>. How can I get the client side ID of server control?
Also how can I set it from both HTML and from server side code?
you can use like this : document.getElementbyId(‘<%=rdbMyocardial.ClientID%>’)