是否有可能获得在JavaScript按钮的命令参数。我不想操纵它,我只是想读它。
Is it possible to get a button's command argument in javascript. I don't want to manipulate it, i just want to read it.
如果可能的 - 如何
请自己的属性,并把它与标准的JavaScript:
Make your own attribute and get it with standard JavaScript:
标记:
<asp:LinkButton ID="LinkButton1" cmdname="test" CommandName="test" CommandArgument="1"
runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
脚本:
//however you choose to get the element, jQuery...etc
document.getElementById('<%=LinkButton1.ClientID %>').cmdname