62,025
社区成员
发帖
与我相关
我的任务
分享
<asp:Repeater ID="cartlist" runat="server" OnItemCommand="cartlist_ItemCommand">
<HeaderTemplate>
<table>
<tr>
<td width="40" align="center">
<asp:CheckBox ID="Checkall" runat="server" onclick="javascript:selectall(this);" />
</td>
<td width="102" height="36" align="center" class="cart">商品编号</td>
<td width="250" align="center" class="cart">商品描述</td>
<td width="104" align="center" class="cart">购买数量</td>
<td width="90" align="center" class="cart">价格</td>
<td width="88" align="center" class="cart">商品编辑</td>
</tr>
<tr>
<td colspan="6" bgcolor="#D9D9D9" style="height: 1px"></td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="tel4" runat="server" onkeyup="value=value.replace(/[^\d]/g,'') " Text='<%#Eval("S_count") %>'
onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" maxlength="3"
style="width:20px; height:16px; border-width:1px; border-style:solid; border-color:#E3E3E3; font-family: Arial, Helvetica, sans-serif; font-size: 11px; font-style: normal;"></asp:TextBox>
</td>
<td width="20" align="center"> 套 </td>
</tr>
<tr>
<td colspan="6" bgcolor="#D9D9D9" style="height: 1px"></td>
</tr>
</table>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
protected void cartlist_ItemCommand(object source, RepeaterCommandEventArgs e)
{
if (e.CommandName == "Change")
{
TextBox lb = (TextBox)e.Item.FindControl("tel4");
if (lb.Text.Length != 0)
{
if (C_Shopping.ChangeCount(sid, Convert.ToInt32(lb.Text)))
{
bind();
}
}
else
{
ClientScript.RegisterStartupScript(GetType(), "确定", "alert('请输入正确的数字')", true);
}
}
}
}