title: How to access the value of the Label present inside Datagrid asp.net using jquery?
body: <pre><code> &lt;asp:DataGrid ID="datagrid1" runat="server" AutoGenerateColumns="False" Width="100%"
                      DataKeyField="Expr1" OnItemCommand="datagrid1_ItemCommand" EmptyDataText="No Records Found" 
                      &gt;
                      &lt;HeaderStyle BackColor="#2E882E" Font-Bold="True" ForeColor="#FFFFCC" HorizontalAlign="Left" /&gt;
                      &lt;Columns&gt;
                          &lt;asp:TemplateColumn HeaderText=""&gt;
                              &lt;ItemTemplate&gt;
                                  &lt;table&gt;
                                      &lt;tr&gt;
                                           &lt;td class="style1"&gt;
  &lt;asp:Label ID="lblStatus" runat="server" Text='&lt;%# Eval("Status") %&gt;'&gt;&lt;/asp:Label&gt;
                                          &lt;/td&gt;
    &lt;/tr&gt;
                                  &lt;/table&gt;
                              &lt;/ItemTemplate&gt;
                          &lt;/asp:TemplateColumn&gt;
                      &lt;/Columns&gt;
                  &lt;/asp:DataGrid&gt;
  </code></pre>
  
  <p>How can i access this Status Label value using <code>jquery</code> Please help </p>
  
  <pre><code>   var DataGrid1 = $("&lt;%=datagrid1.ClientID %&gt;");
  var status = $(DataGrid1).children("lblStatus").get(0).innerHTML;
  </code></pre>
  
  <p>Will the above code work?</p>
  
  <p>EDIT : Tried using this code as suggested</p>
  
  <pre><code> $(document).ready(function () {
          $('.vini').click(function () {
              //var status = $("#&lt;%=ddlstatus.ClientID%&gt;").val();
              var DataGrid1 = $("#&lt;%=datagrid1.ClientID %&gt;");
                var status =$(DataGrid1).find("txtStatDesc").html();
  
  
  
  
              if (status == 'Sent') {
                  var _Action = confirm('Do you really want to cancel this payment ? All pending money will be available in the retention account of the contractor ');
                  if (_Action) {
                      $.blockUI({ css: {
                          border: 'none',
                          padding: '15px',
                          backgroundColor: '#000',
                          '-webkit-border-radius': '10px',
                          '-moz-border-radius': '10px',
                          opacity: .5,
                          color: '#fff'
                      }
                      });
                      return true;
                  }
                  else {
                      return false;
                  }
  
  
              }
  
          });
      }); 
  </code></pre>
  
  <p><strong>I am not able to fetch the status but</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/bqWsu.png" alt="enter image description here"></p>