vb.net - unable to pass gridview row number to javascript function -
i trying pass row number of gridview javascript function when checkbox clicked. here checkbox code inside gridview
<asp:checkbox id="chkgroup" runat="server" commandargument='<%#eval("tempfaultid")%>' onclick="highlightdescription('+<%# ctype(container,gridviewrow).rowindex %>+',this.checked);"> </asp:checkbox>
here javascript function check box trigger
<script language="javascript" type="text/javascript"> function highlightdescription(index, state) { alert(index + state); } </script>
here output
problem unable row index. !
use <%# tag on entire onclick function:
<asp:checkbox id="chkgroup" runat="server" onclick=<%# string.format("highlightdescription('{0}',this.checked);", ctype(container,gridviewrow).rowindex) %> > </asp:checkbox>
Comments
Post a Comment