本文介绍了每次用户单击产品时我如何增加商品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个盒子...我要显示购物车中的物品,我的意思是用户单击的物品数...因此,当用户每次单击产品时,我该如何增加物品
i have one box...there i want to show the cart items i mean number of items the user clicks...so how can i increment the items when each time user clicks on the products
推荐答案您没有指定环境,Web或Windows.但是,在ASP.NET环境中,这类事情通常是通过使用会话变量来完成的.在Windows中,它只是一个表单变量或一个字段,是一个实体类. You didn''t specify the environment, Web or Windows. However, in an ASP.NET environment this sort of thing is usually accomplished by using a session variable. In Windows it would simply be a form variable or a field an entity class.
您好, 我以文本框为例,因此请使用下面的代码来控制您选择的wat. Hi, I am giving example for textbox, so use the below code for wat ever control you selected. protected void Button1_Click(object sender, EventArgs e) { int i = 0; if (TextBox1.Text != string.Empty) i = int.Parse(TextBox1.Text); TextBox1.Text = Convert.ToString(i + 1); }
更多推荐
每次用户单击产品时我如何增加商品
发布评论