Get object from ListView when clicking button in the row - ASP.NET C#
<p>I have a question about getting object (or at least ID of an object) from a listview in asp.net when i click on the button in the listview. SelectedIndexChanged event doesnt fire. Whats other option? </p>

<p>My listview with 2 image buttons in it (info and shopping cart): </p>

<p><img src="https://i.stack.imgur.com/EMCvg.png" alt="screenshot"></p>

<p>My aspx code:</p>

<pre><code>&lt;asp:ListView ID="ListView1" runat="server" OnSelectedIndexChanged="ListView1_SelectedIndexChanged"&gt;
    &lt;ItemTemplate&gt;
        &lt;tr&gt;
            &lt;td class="text-left"&gt;&lt;%# Eval("naziv")%&gt;&lt;/td&gt;
            &lt;td class="text-left"&gt;&lt;%# Eval("cena")%&gt;&lt;/td&gt;
            &lt;td class="text-left"&gt;
                &lt;asp:ImageButton ID="ImageButton1" runat="server"  ImageUrl="~/info_512pxGREY.png" Height="50px" Width="50px" /&gt;&lt;/td&gt;
            &lt;td class="text-left"&gt;
                &lt;asp:ImageButton ID="ImageButton2" runat="server" Height="50px" Width="50px"  ImageUrl="https://cdn2.iconfinder.com/data/icons/picons-basic-2/57/basic2-011_shopping_cart-512.png" /&gt;
                &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/ItemTemplate&gt;
    &lt;LayoutTemplate&gt;
        &lt;table class="table-fill" id="tbl1" runat="server"&gt;
            &lt;thead&gt;
                &lt;tr id="tr1" runat="server"&gt;
                &lt;th id="td1" runat="server"&gt;Naziv&lt;/th&gt;
                &lt;th id="td2" runat="server"&gt;Cena&lt;/th&gt;
                &lt;th id="td3" runat="server"&gt;Info&lt;/th&gt;
                &lt;th id="td4" runat="server"&gt;Kupi&lt;/th&gt;
            &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tr id="ItemPlaceholder" runat="server"&gt;  
            &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/LayoutTemplate&gt;
&lt;/asp:ListView&gt;
</code></pre>