日期:2014-05-17 浏览次数:20474 次
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<div class="order">订购请勾选
<asp:CheckBox ID="CheckBox1" runat="server" CssClass='<%#Eval("序号") %>' />
数量
<asp:TextBox runat="server" id="text3" class="numbers" ></asp:TextBox>
</div>
</div>
</ItemTemplate>
</asp:Repeater>
for (int i = 0; i < Repeater1.Items.Count; i++)
{
int num = Convert.ToInt32(((TextBox)Repeater1.Items[i].FindControl("text3")).Text);
CheckBox cb = (CheckBox)Repeater1.Items[i].FindControl("CheckBox1");
if (cb.Checked)
{
strsql = "insert into tmwsc_uesr_dd (产品序号,数量)values('"+ cb.CssClass +"','"+ num + "')";
bool zz = Das.ExecSql(strsql);
}
}