Set Your DataList DataKeyField and follow the bellow code:
<asp:datalist id="dlPhotos" runat="server" repeatcolumns="5" xmlns:asp="#unknown">
RepeatDirection="Horizontal" BorderColor="#336699" BorderStyle="Solid"
BorderWidth="1px" CellPadding="3" DataKeyField="SLNO"
onitemcommand="dlPhotos_ItemCommand">
<itemtemplate>
<asp:imagebutton id="imgView">
ImageUrl='<%# "Handler.ashx?ImgId=" + Eval("SLNO") %>' runat="server"
Height="110px" Width="150px" CommandName="Select" />
<br />
<asp:label id="Label1" runat="server" text="<%# Eval("PHOTO_TITLE") %>" font-bold="True">
Font-Size="10pt" ForeColor="#336699" Width="100%" />
</itemtemplate>
<itemstyle horizontalalign="Center" verticalalign="Top" />
protected void dlPhotos_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Select")
{
int strId = Convert.ToInt32(dlPhotos.DataKeys[e.Item.ItemIndex].ToString());
}
}