Get Cell Data out of GridView with JavaScript/jQuery -


i have asp.net gridview server control.

i want image button server control.

when user clicking on image, jquery/javascript method should extract value column in row, click event started.

<tr>   <td>col1</td>   <td>col2</td> <!-- perhaps want cell value -->   <td>col3</td> </tr> 

i have tried this: function:

function readcellvalue() {     $(this).closest("tr").find("td:eq(#2)").val();//i error message undefined     return false;//avoid reloading process of site  } 

grid view:

     <asp:gridview>              <columns>                    <asp:boundfield ... />                 <asp:boundfield ... />                 <asp:boundfield ... />                 <asp:templatefield>                    <itemtemplate>                       <asp:imagebutton id="imgbtn"runat="server" onclientclick="return readcellvalue();"/>                                 </itemtemplate>                 </asp:templatefield>              </columns> </asp:gridview> 


Comments