我有一个中继器,每行都有一个链接按钮,代码如下:
<asp:Repeater ID="rpt_OutstandingBCsForClient" runat="server">
<ItemTemplate>
<div class="pay">
<table>
<tr>
<td>
<div style="width: 230px;">
<asp:Label ID="lbl_Len" runat="server" ></asp:Label>
</div>
</td>
<td align="left">
<div style="width: 80px;">
<asp:LinkButton ID="lnkbtn_Remove" runat="server">Remove</asp:LinkButton>
</div>
</td>
</tr>
</table>
</div>
</ItemTemplate>
</asp:Repeater>
我想在单击按钮时禁用或隐藏 ID 为“lnkbtn_Remove”的所有链接按钮,所以我已经这样做了,但它仍然不起作用,如果在 var linkButton1 之后发出警报,我得到一个对象,但它不会禁用或隐藏链接按钮:
$("input[id$='btnP']").click(function (e) {
var linkButton1 = $('[id*="lnkbtn_Remove"]');
$.ajax({
type: "POST",
url: "MyPage.aspx/Take",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
if (msg.d.indexOf('https://') > -1) {
$('#lnkbtn_Remove').attr("disabled", true);
}
else {
}
}
});
e.preventDefault();
});