我想读取JQuery中的项目值,根据我希望启用或禁用基于标签值的列表视图中的锚定标记的值。任何帮助,将不胜感激。如何阅读JQuery中的列表视图项目(标签)
$(document).ready(function() {
$('#Coverage-link').live('click', function(e) {
var IsRestriction = ***I want to read a label text(lblRestrictions) here***
if (IsRestriction == "More") {
$('#Coverage-form').dialog('open');
} else {
e.preventDefault();
}
return false;
});
});
ListView项 -
<ItemTemplate>
<tr >
<td align="left" style="width:180px">
<asp:Label ID="lblDrugName" runat="server" Text='<%# Eval("DrugDescription") %>' />
</td>
<td style="width:120px" align="center">
<asp:Label ID="lblStatus" runat="server" Text='<%# Eval("FormularyStatusDescription") %>' />
</td>
<td align="left" style="width:250px">
<asp:Label ID="lblFlat" runat="server" Text='<%# Eval("CopayInfo") %>' />
</td>
<td style="width:80px;padding-right:10px;" align="center">
<!--<asp:Label ID="lblCoverageRestrictions" runat="server" Text='<%# Eval("Restrictions") %>' /> -->
<a href="#" id="Coverage-link">
<asp:Label ID="lblRestrictions" runat="server" Text='<%# Eval("Restrictions") %>' ></asp:Label>
</a>
</td>
</tr>
</ItemTemplate>
下面是HTML输出 -
<table id="eligibility-data">
<thead style="background-color:#90a595;">
<th style="width:180px">Drug Name</th>
<th style="width:120px;">Formulary Status</th>
<th align="left" style="width:250px">Copay Information</th>
<th style="width:80px;padding-right:10px">Restrictions</th>
</thead>
<tbody>
<tr >
<td align="left" style="width:180px">
<span id="ctl00_MainContentPlaceholder_formularyControl_lvCopayInformation_ctrl0_lblDrugName">ibuprofen 200 mg oral capsule</span>
</td>
<td style="width:120px" align="center">
<span id="ctl00_MainContentPlaceholder_formularyControl_lvCopayInformation_ctrl0_lblStatus">On - Preferred (2)</span>
</td>
<td align="left" style="width:250px">
<span id="ctl00_MainContentPlaceholder_formularyControl_lvCopayInformation_ctrl0_lblFlat">No Copay Info Available.</span>
</td>
<td id="tdRestrictions" style="width:80px;padding-right:10px;" align="center">
<!--<span id="ctl00_MainContentPlaceholder_formularyControl_lvCopayInformation_ctrl0_lblCoverageRestrictions">None</span> -->
<a href="#" id="Coverage-link">
<span id="ctl00_MainContentPlaceholder_formularyControl_lvCopayInformation_ctrl0_lblRestrictions">None</span>
</a>
</td>
</tr>
</tbody>
</table>
您可以共享最终的HTML输出,而不是ASP服务器端代码吗? – Blazemonger
请找到添加的HTML代码。 – Senthil