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

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -