【发布时间】:2011-04-02 15:49:06
【问题描述】:
当用户单击添加框属性时,需要使用 jquery 动态创建上面的行(即需要添加 2 个下拉列表和文本框的行)(这样就没有回发)。用户将被允许添加任意数量的属性,并且当他们单击需要删除该行的复选框时。 jquery如何实现这一点。
<asp:Panel ID="pnl_BoxAttr" runat="server">
<table>
<tr>
<th>
Name
</th>
<th>
Comparision
</th>
<th>
Value
</th>
<th>
Delete
</th>
</tr>
<tr>
<td>
<asp:DropDownList ID="ddl_BoxName" runat="server">
<asp:ListItem Value="attr1" Selected="True"></asp:ListItem>
<asp:ListItem Value="attr2"></asp:ListItem>
<asp:ListItem Value="attr3"></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:DropDownList ID="ddl_BoxComparision" runat="server">
<asp:ListItem Value="=" Selected="true"></asp:ListItem>
<asp:ListItem Value=">"></asp:ListItem>
<asp:ListItem Value="<"></asp:ListItem>
<asp:ListItem Value="Like"></asp:ListItem>
<asp:ListItem Value="!="></asp:ListItem>
</asp:DropDownList>
</td>
<td>
<asp:TextBox ID="btn_boxval" runat="server" ></asp:TextBox>
</td>
<td>
<asp:CheckBox ID="chk_DeleteBoxRow" runat="server" />
</td>
</tr>
<tr>
<td colspan="3">
<asp:Button ID="btn_AddAttr" Text="Add Box Attribute" runat="server"/>
</td>
</tr>
</table>
</asp:Panel>
【问题讨论】:
标签: asp.net jquery jquery-selectors