0
Answer

ProductId From Datalist in ImageButton

Erinc Kuzu

Erinc Kuzu

18y
1.8k
1
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" Height="399px" RepeatColumns="2" RepeatDirection="Horizontal">
    <ItemTemplate>

        <asp:ImageButton  height="43" src="arts/Btn_AddBox.gif" vspace="3" width="21" ImageUrl="~/arts/Btn_Buy.gif" ID="ImageButton" runat="server" />

</ItemTemplate>
</asp:DataList>

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DB_ConnectionString %>" SelectCommand="SELECT ProductId FROM [tblProducts] Where ProductMasterPage=1">
</asp:SqlDataSource>

I make a ShopingBox

How can i have ProductId(coming from SQL Query) in Codebehind when i click on the imagebutton ?