The same thing you do with every other button:
<asp:Button ID="templateButton" runat="server" OnClick="templateButton_OnClick"/>
Except that you will need to determine which button was pressed in the handler itself.
protected void templateButton_OnClick(object sender, EventArgs e) { Button myButton = (Button)sender; }
source share