How can I use CommandArgument of LinkButton in jQuery? -
i have 5 link buttons. , want send command argument web method load on page scroll.
$.ajax({ type: "post", url: "default.aspx/getcustomers", data: '{pageindex:'+pageindex+'}', contenttype: "application/json; charset=utf-8", datatype: "json", success: onsuccess, failure: function (response) { alert('hell 1'); }, error: function (response) { alert('hell 2'); } });
no can't use commandargument in jquery because stores in viewstate of page. can use data-...
attribute instead.
<asp:linkbutton id="btnsave" runat="server" text="save" data-id="<%# databinder.eval(container.dataitem, "id") %>" /> <script> var id = $('#btnsave').data('id'); // use id </script>
Comments
Post a Comment