每按一次Button1,在表格Table1中添加一行(行中有2列,一列是文本框,一列是下拉框),并且当按钮第一次按下时再添加一个按钮,点击这个动态添加的按钮,输出表格中所有的控件的值。
前台:
<form id="Form1" method="post" runat="server">
<asp:Table id="Table1" runat="server"></asp:Table>
<asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder><BR><BR>
<asp:Button id="Button1" runat="server" Text="添加一行"></asp:Button>
</form>
<asp:Table id="Table1" runat="server"></asp:Table>
<asp:PlaceHolder id="PlaceHolder1" runat="server"></asp:PlaceHolder><BR><BR>
<asp:Button id="Button1" runat="server" Text="添加一行"></asp:Button>
</form>
文章来源于领测软件测试网 https://www.ltesting.net/
领测软件测试网最新更新