behind method shown here -
protected void DataList1_ItemCommand(object source,DataListCommandEventArgs e)
{
// it will find the datakey
int datakey= Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex].ToString());
if (e.CommandName == "Approve")
{
Panel user = (Panel)e.Item.FindControl("UserCommentPanel2");
//do more
}
}
you can use as many command buttons as you want by giving a unique
command name.in this example i used two command name Select and Approve.