Click here to Skip to main content
15,881,862 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Actually in asp.net dynamically add the control to the listview

but i want to how can u dynamically add the the controls to the listview in MVC



asp.net listview code:



ASP.NET
<asp:ListView ID="lvProducts" runat="server" ItemPlaceholderID="ph">
                <LayoutTemplate>
                    <ul class="productlist">
                        <asp:PlaceHolder ID="ph" runat="server"></asp:PlaceHolder>
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li style="background-image: removed('Img/bgu.jpg');">
                        <asp:ImageButton ID="img1" ImageUrl='<%#Eval("ImagePath") %>' CssClass="img-size"
                            OnClick="lkimage_click" CommandArgument='<%#Eval("ProductId") %>' runat="server" /><br />
                        <asp:LinkButton ID="LinkButton11" runat="server" CausesValidation="False" Text='<%#Eval("link") %>'
                        CommandArgument='<%#Eval("ProductId") %>'    OnClick="lk_click" ForeColor="Blue"></asp:LinkButton></li>
                </ItemTemplate>
                <EmptyItemTemplate>
                    <h4 class="warning">
                        No-Products to Display</h4>
                </EmptyItemTemplate>
            </asp:ListView>




Finally i want MVC list view code i.e design the list view and dynamically add the

controles in mvc

Please help me.
thank u
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900