<asp:DataList ID="dlstUrun" runat="server" RepeatColumns="3" DataKeyField="Id" SeparatorStyle-Width="0px" RepeatDirection="Vertical" OnItemCommand="dlstUrun_ItemCommand" EnableViewState="true"> <ItemTemplate> <div class="col-md-4 col-sm-6"> <div class="product-box" style="width:300px; padding-left: 0px; padding-right: 0px;"> <div class="imagebox style8"> <div class="box-image owl-carousel-1"> <a href="#" title=""> <asp:ImageButton ID="ImageButtonMain" runat="server" AlternateText='<%#Eval("Adi") %>' ImageUrl='<%# string.Format("~/images/product/other/{0}",Eval("PictureMain"))%>' CommandName="detay" CommandArgument='<%#Eval("Id") %>' /> </a> <a href="#" title=""> <asp:ImageButton ID="ImageButton1" runat="server" AlternateText='<%#Eval("Adi") %>' ImageUrl='<%# string.Format("~/images/product/other/{0}",Eval("Picture1"))%>' CommandName="detay" CommandArgument='<%#Eval("Id") %>' /> </a> <a href="#" title=""> <asp:ImageButton ID="ImageButton2" runat="server" AlternateText='<%#Eval("Adi") %>' ImageUrl='<%# string.Format("~/images/product/other/{0}",Eval("Picture2"))%>' CommandName="detay" CommandArgument='<%#Eval("Id") %>' /> </a> </div> <!-- /.box-image --> <div class="box-content"> <div class="cat-name"> <a href="#" title=""> <asp:Label ID="Label3" runat="server" Text='<%#Eval("GrupAdi") %>'></asp:Label></a> </div> <div class="product-name"> <a href="#" title=""> <asp:Label ID="Label1" runat="server" Text='<%#Eval("Adi") %>'></asp:Label></a> </div> <div class="price"> <span class="sale"> <asp:Label ID="Label2" runat="server" Text='<%#Eval("Fiyat", "{0:N}") %>'></asp:Label></span> </div> </div> <!-- /.box-content --> <div class="box-bottom"> <div class="btn-add-cart"> <a title=""> <asp:ImageButton ID="ImageButtonGo" runat="server" AlternateText='<%#Eval("Adi") %>' ImageUrl="images/icons/add-cart.png" CommandName="detay" CommandArgument='<%#Eval("Id") %>' /> <%--<img src="images/icons/add-cart.png" alt="">Add to Cart--%> </a> </div> <div class="compare-wishlist" hidden> <a href="#" class="compare" title=""> <img src="images/icons/compare.png" alt="">Compare </a> <a href="#" class="wishlist" title=""> <img src="images/icons/wishlist.png" alt="">Wishlist </a> </div> </div> <!-- /.box-bottom --> </div> <!-- /.imagebox style8 --> </div> <!-- /.product-box --> </div> <!-- /.col-md-4 col-sm-6 --> </ItemTemplate> </asp:DataList>
protected void dlstUrun_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "detay") { int ID = Convert.ToInt32(e.CommandArgument); Response.Redirect("Product.aspx?id=" + ID); } }
<a href="#" title=""> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl='/images/usesomestaticImage.jpg' CommandName="detay" CommandArgument='<%#Eval("Id") %>' /> </a>
<a href="#" title="">...</a>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)