dabinDev 2015-06-17 03:28 采纳率: 0%
浏览 3350
已结题

ASP.NET动态添加节点 实现每次单击动态生table中的行列

图片说明
点击这个添加更多动态复制上面的div中的table里面的控件 后台可以获取到每个table中标签的id 或者直接可以获取 多个table中控件上的数据

我是asp的新手不清楚这个 这个服务器的控件的js代码怎么写 或者可以直接在控件的添加更多事件里面实现


    <div id="divtable">
<table class="add_table" id="table" width="100%">
     <tr>
        <td width="90">产品编号</td>
        <td>
            <asp:TextBox ID="product_no" runat="server" TextMode="Number"></asp:TextBox>
            <asp:RequiredFieldValidator ID="reg_no" runat="server" ErrorMessage="✘请输入编号" ControlToValidate="product_no" ForeColor="Black"></asp:RequiredFieldValidator>
        </td>
    </tr>
     <tr>
        <td width="90" class="auto-style1">产品名称</td>
        <td class="auto-style1">
            <asp:TextBox ID="product_name" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="reg_name" runat="server" ErrorMessage="✘请输入名称" ControlToValidate="product_name"></asp:RequiredFieldValidator>
       </td>
    </tr>
       <tr>
        <td width="90">产品价格</td>
        <td>
            <asp:TextBox ID="product_price" runat="server" TextMode="Number"></asp:TextBox>
            <asp:RequiredFieldValidator ID="reg_price" runat="server" ErrorMessage="✘请输入价格" ControlToValidate="product_price"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td width="90">产品型号</td>
        <td>
            <asp:TextBox ID="product_model" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="reg_mod" runat="server" ErrorMessage="✘请输入型号" ControlToValidate="product_model" Width="100px"></asp:RequiredFieldValidator>
&nbsp;
            <asp:FileUpload ID="selectfile" runat="server" ToolTip="请选择文件" />
        </td>
    </tr>
    <tr>
        <td width="90">产品描述</td>
        <td>

            <asp:TextBox ID="product_introduce" runat="server" Width="524px" TextMode="MultiLine" Height="24px"></asp:TextBox>
        </td>
    </tr>
</table>
        <div align="center">
            <asp:Button ID="addmore" runat="server" Text="↓添加更多" OnClick="addmore()" />
            <br />
            <br />
            <asp:Button ID="btnDo" runat="server" Text="执行操作" OnClick="btnDo_Click" />
        </div>
        </div>
</asp:Content>
  • 写回答

4条回答 默认 最新

  • Tiger_Zhao 2015-06-17 03:51
    关注

    这个服务端做比较容易。
    把整个Table的内容(不包括

    )用一个asp:repeater包起来,绑定一个 datatable;(addmore.click中)你给 datatable 多添加一行,就会多生成一次内容。
    评论

报告相同问题?

悬赏问题

  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料