I am using the following code to call a javascript function but the OnClientClick expression is never evaluated.
<asp:Button ID="btn1" UseSubmitBehavior="false"
OnClientClick='moveComment(txtComment_<%# Eval("Container.DataItemIndex") %>)'
runat="server" Text="add comment"/>
Here is the answer:
And GetId method on the server side:
protected string GetId(string index)
{
return “moveComment(‘txtComment_”+ index +”‘)”;
}