javascript - Getting UniqueID inside OnClientClick() to pass as a parameter to a JS function -
i using devexpress grid , dataitemtemplate column follows:
<dataitemtemplate> <asp:button visible="true" enableviewstate="false" cssclass="btn btn-sm btn-danger" data-confirm="are sure want delete organisation member?" id="deletebutton" data-id="<%#: container.keyvalue %>" runat="server" text="delete" onclientclick=' return deleteconfirm("<%= uniqueid %>"); ' onclick="deletebutton_onclick" /> </dataitemtemplate>
i want pass unique identifier button js function deleteconfirm() parameter.
however instead of unique identifier getting string <%= uniqueid %>
how unique identifier each button passed parameter?
item within <%= %>
or <%# %>
notation cannot references properties on object itself. should able pass this
, use button directly though:
return deleteconfirm(this);
the this
reference reference button.
Comments
Post a Comment