<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>
如何使用jquery
请帮助访问此状态标签值
var DataGrid1 = $("<%=datagrid1.ClientID %>");
var status = $(DataGrid1).children("lblStatus").get(0).innerHTML;
上面的代码会起作用吗?
编辑:按照建议尝试使用此代码
$(document).ready(function () {
$('.vini').click(function () {
//var status = $("#<%=ddlstatus.ClientID%>").val();
var DataGrid1 = $("#<%=datagrid1.ClientID %>");
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;
}
}
});
});
我无法获取状态,但