How to access the value of the Label present inside Datagrid asp.net using jquery?
- by vini
<asp:DataGrid ID="datagrid1" runat="server" AutoGenerateColumns="False" Width="100%"
DataKeyField="Expr1" OnItemCommand="datagrid1_ItemCommand" EmptyDataText="No Records Found"
>
<HeaderStyle BackColor="#2E882E" Font-Bold="True" ForeColor="#FFFFCC" HorizontalAlign="Left" />
<Columns>
<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<table>
<tr>
<td class="style1">
<asp:Label ID="lblStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
How can i access this Status Label value using jquery Please help
var DataGrid1 = $("<%=datagrid1.ClientID %>");
var status = $(DataGrid1).children("lblStatus").get(0).innerHTML;
Will the above code work?