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.
If possible - how?
Make your own attribute and get it with standard JavaScript:
Markup:
<asp:LinkButton ID="LinkButton1" cmdname="test" CommandName="test" CommandArgument="1"
runat="server" onclick="LinkButton1_Click">LinkButton</asp:LinkButton>
Script:
//however you choose to get the element, jQuery...etc
document.getElementById('<%=LinkButton1.ClientID %>').cmdname
You can put command argument into some hidden field, then retrieve the value of the hidden field in javascript after page loads such as $(document).ready() in JQuery.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With