in your .aspx
<asp:datalist id="dlstProducts" runat="server" repeatcolumns="3" cellspacing="5" repeatdirection="Horizontal" repeatlayout="Table" onitemcommand="dlstProducts_ItemCommand">
<itemtemplate>
<asp:button id="btnDetails" runat="server" commandname="Details" cssclass="RepeaterDetails" text="Details" commandargument="<%# Eval("ID") %>"></asp:button>
</itemtemplate>
</asp:datalist>
in .cs
protected void dlstProducts_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Details")
{
string value = (string)e.CommandArgument;
}
}