如何在asp.net中使用javascript获取命令准备的价值 [英] How to get value of command arugment using javascript in asp.net
本文介绍了如何在asp.net中使用javascript获取命令准备的价值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<asp:LinkButton ID="lnkprogress" runat="server" class="label label-info" BackColor="#589FC2" CommandArgument='<%#Eval("BookingId")%>' OnClientClick="jk();" >In progress</asp:LinkButton>
此按钮存在于中继器的每一行中.我想使用javascript.please答复获取命令参数的值
This button exist in repeater for every row.I want to get the value of command argument using javascript.please reply
推荐答案
<asp:LinkButton ID="lnkprogress" runat="server" class="label label-info"
BackColor="#589FC2" data-CommandArgument='<%#Eval("BookingId")%>'
OnClientClick="jk();" >In progress</asp:LinkButton>
使用JavaScript:
Using Javascript:
document.getElementsId("lnkprogress")[0].getAttribute("CommandArgument")
使用jQuery:
$('#lnkprogress').data('CommandArgument');
这篇关于如何在asp.net中使用javascript获取命令准备的价值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文