在2个转发器中使用命令参数

时间:2018-03-07 09:40:10

标签: c# asp.net webforms

我有两个转发器控件,在第二个控件中,我想插入一个linkbutton,这样我就可以在commad参数中输入数据了。 例如,单击墨水按钮时,产品将添加到我的购物篮

 <div id="productTabContent" class="tab-content">
            <asp:Repeater ID="rpProductcatNew" runat="server" OnItemDataBound="rpProductcatNew_ItemDataBound" OnItemCommand="rpProductcatNew_ItemCommand">
                <ItemTemplate>
                    <div class="tab-pane in" id="<%#Eval("id") %>">
                        <div class="featured-pro">
                            <div class="slider-items-products">
                                <div id="computer-slider" class="product-flexslider hidden-buttons">
                                    <div class="slider-items slider-width-col4">
                                        <asp:Repeater ID="rpproductNew" runat="server">
                                            <ItemTemplate>
                                                <div class="product-item">
                                                    <div class="item-inner">
                                                        <div class="product-thumbnail">
                                                            <div class="pr-img-area">
                                                                <a title="<%#Eval("productname") %>" href="/singleProduct/<%#Eval("id")%>">
                                                                    <figure>
                                                                        <img class="first-img" src="/adminpanel/files/<%#Eval("pic") %>" alt="<%#Eval("productname") %>">
                                                                        <img class="hover-img" src="/adminpanel/files/<%#Eval("picHover") %>" alt="<%#Eval("productname") %>">
                                                                    </figure>
                                                                </a>
                                                            </div>
                                                            <div class="pr-info-area">
                                                                <div class="pr-button">

                                                                    <div class="mt-button add_to_compare">
                                                                        <asp:LinkButton runat="server" ToolTip="مقایسه" CommandName="Compare" CommandArgument='<%#Eval("id") %>'><i class="fa fa-link"></i></asp:LinkButton></div>
                                                                    <div class="mt-button quick-view"><a title="بررسی" href="/QuickView/<%#Eval("id") %>"><i class="fa fa-search"></i></a></div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="item-info">
                                                            <div class="info-inner">
                                                                <div class="item-title"><a title="<%#Eval("productname") %>" href="/singleProduct/<%#Eval("id")%>"><%#Eval("productname") %> </a></div>
                                                                <div class="item-content">
                                                                    <%--<div class="rating"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i><i class="fa fa-star-o"></i></div>--%>
                                                                    <div class="item-price">
                                                                        <div class="price-box"><span class="regular-price"><span class="price"><%#Eval("price") %> &nbsp تومان </span></span></div>
                                                                    </div>
                                                                    <div class="pro-action">
                                                                        <asp:Button runat="server" CssClass="add-to-cart" CommandName="AddCart" CommandArgument='<%#Eval("id") %>' Text="اضافه به سبد خرید" />
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </ItemTemplate>
            </asp:Repeater>

        </div>

如何在内部转发器上使用OnItemCommand?

0 个答案:

没有答案