I have many LinkButton such as:
<asp:LinkButton runat="server" onclick="cmdCancellaComunicazione_Click">X</asp:LinkButton>
they call the same server method, cmdCancellaComunicazione_Click. but I need to distinguish them (passing to the server, for example, a value).
How can I do it? I know there is CommandArgument, but I can’t set to it a value such as <%= myValue %>
Your code has no
IDspecified on yourLinkButtonwhich seems odd.You should be able to assign the
CommandArgumentserver side with:And then it will be read it server side in your
OnClickhandler.Is this being created in a grid or something that is being bound? If so I would implement the
OnDataBindingevent for theLinkButtonlike:Server side code (I try to avoid inline code whenever possible):
Is there something more to your scenario that you have not included in your question?