Is it possible to get button command argument in javascript. I do not want to manipulate it, I just want to read it.
If possible, how?
Create 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 the command argument in some kind of hidden field, and then get the value of the hidden field in javascript after loading the page, for example $ (document) .ready () in jQuery.
The short answer is NO if you are ONLY using javascript. But you can get it using an ajax call on the server or using a hidden field such as JW suggested. This property is not even available from themes. Read the documentation in msdn for more information .
Source: https://habr.com/ru/post/886195/More articles:The correct way to verify the parameters passed to the Mock is set as expected - c #Mix Confirmation and Action in AAA Unit Testing Syntax - unit-testingProblems with Redis? - performanceUpdate pane and triggers from a relay controller - asp.netR in C, specifying the row / column names of the matrix - cC # Uri loading not deterministic? - c #Facebook error in Android "Login error: com.facebook.android.DialogError: the connection to the server was unsuccessful" - androidDownload an OpenXML file without a temporary file - c #How to rotate a WPF window? - c #Can you explain this cryptic code? - c ++All Articles