每次用户单击产品时我如何增加商品

编程入门 行业动态 更新时间:2024-10-25 04:17:44
本文介绍了每次用户单击产品时我如何增加商品的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个盒子...我要显示购物车中的物品,我的意思是用户单击的物品数...因此,当用户每次单击产品时,我该如何增加物品

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); }

更多推荐

每次用户单击产品时我如何增加商品

本文发布于:2023-10-22 22:27:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1518915.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:单击   商品   用户   产品

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!