I have a grid with a link and what I want to achieve is when the link is clicked, to open a modal window. My modal is working properly. I'm just having issue with getting the link to do something. Below is my example code.
ASPX:
<asp:GridView AutoGenerateColumns="False" Width="100%" ID="grvUsers" runat="server">
<Columns>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="Label1" runat="server" Text='<%# eval("ID") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
HTML render:
<table cellspacing="0" rules="all" border="1" id="grvUsers" style="width: 100%; border-collapse: collapse;">
<tr>
<th scope="col">Delete</th>
</tr>
<tr>
<td>
<span id="grvUsers_Label1_0">23</span>
</td>
</tr>
</table>
jQuery:
$(document).ready(function(){
$('td:nth-col(0)').click(function(){
alert("OMG");
});
});
<tbody/>element?:first-child. what is the result of just$('td:nth-col(0)'), do you have a result ?