如何在转发器中添加带有textbox / dropdownlist / checkbox的新行? [英] How to add new rows with textbox/dropdownlist/checkbox in a repeater?

查看:70
本文介绍了如何在转发器中添加带有textbox / dropdownlist / checkbox的新行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用转发器,

我必须在按钮上添加textbox / dropdownlist / chekcbox点击新行。

n

i必须将这些项目插入数据库。



我的中继器:

Hi guys,

i'm working on a repeater,
where i have to add textbox/dropdownlist/chekcbox on button click in a New Row.
n
i have to insert those items in a database.

my repeater:

<asp:Repeater ID="Repeater1" runat="server"
                                                  onitemdatabound="Repeater1_ItemDataBound">
                                         <HeaderTemplate>
                                             <table class="table table-bordered table-hover">
                                                 <thead class="bg-dark lt">
                                                     <tr>
                                                         <th>
                                                             S.No#
                                                         </th>
                                                         <th>
                                                             Item
                                                         </th>
                                                         <th>
                                                             Description
                                                         </th>
                                                         <th>
                                                             Quantity
                                                         </th>
                                                         <th>
                                                             Remarks
                                                         </th>
                                                     </tr>
                                                 </thead><tbody>
                                         </HeaderTemplate>

                                             <itemtemplate>
                                         <tr>
                                         <td>
                                         <%# Container.ItemIndex + 1 %>
                                         </td>
                                         <td><asp:TextBox ID="txtitem" runat="server"></asp:TextBox></td>
                                         <td><asp:TextBox ID="txtdescription" Width="300px"  TextMode="MultiLine" runat="server"></asp:TextBox></td>
                                         <td><asp:TextBox ID="txtqty" Width="50px" runat="server"></asp:TextBox></td>
                                         <td><asp:TextBox ID="txtremarks" Width="300px" TextMode="MultiLine" runat="server"></asp:TextBox></td>

                                         </tr>
                                         </itemtemplate>
                                         <Footertemplate>
                                             </tbody>
                                             </table>
                                         </FooterTemplate>
                                     </asp:Repeater>





点击按钮;我想向转发器添加更多行。



plz伙伴们帮助我。



谢谢。



On button click; i want to add more rows to the repeater.

plz guys help me.

Thanks.

推荐答案

你可以在UserControl中添加你的控件并尝试这个解决方案,如果它适合你:



如何将网络用户控件添加到转发器 [ ^ ]
you can add your controls inside a UserControl and try this solution if it works for you:

How to add web user controls to repeater[^]


您好,



您可以按照以下链接在转发器中添加带控件的新行。



http://www.c-sharpcorner.com/Blogs/10913 /add-dynamic-row-using-repeater.aspx [ ^ ]


这篇关于如何在转发器中添加带有textbox / dropdownlist / checkbox的新行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆