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

enter image description here

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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -