ciao,
se non ho capito male tu usi l'evento ItemCommand pilotato da un linkbutton, quindi in quell'evento hai anche il fatto di sapere il "sender" ovvero il controllo che ti ha fatto il click:
protected void dataList_ItemCommand(object sender, DataListCommandEventArgs e)
{
if (e.CommandSource.GetType() == typeof(LinkButton))
{
LinkButton btn = e.CommandSource as LinkButton;
....
e poi dentro li hai anche la possibilità di farti passare un ItemCommand (recuperabile tramite "e.CommandArgument") ti basta impostarlo nel LinkButton:
<asp:LinkButton ID="lnkButton" runat="server" Text="Cliccami"
CommandName="Select" CommandArgument="..." />
oppure verificare il valore selezionato, ovvero quello che hai messo come "dataKey" della DataList e che quindi ti ritrovi chiedendo la proprietà "SelectedValue", con un DataList in questa forma:
<asp:DataList ID="lista" runat="server"
DataKeyField="numero" OnItemCommand="lista_ItemCommand" >
...
ciao.
Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo