asp.net vb脚本中的购物车 [英] shopping cart in asp.net vb script

查看:69
本文介绍了asp.net vb脚本中的购物车的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用vb脚本在asp.net中创建购物车?
给我逐步指南... plz

how to create shopping cart in asp.net using vb script?
give me step by step guide...plz

推荐答案

由于这听起来像是作业,所以我不会给您任何代码!

您需要查看的第一件事是数据持久性:将选定的项目保留在页面之间.两个有四个选项:
1)会话变量
2)页面地址参数
3)Cookies
4)数据库

第一个是好的,简单的和易于使用的,但是如果浏览器关闭,连接断开或超时,所有数据都会丢失.

第二个很简单,但是当您将项目添加到页面重定向中时看起来很乱,与Google传递参数的方式几乎相同:
Since this smells like homework, I won''t give you any code!

The first thing you need to look at is data persistence: keeping the chosen items between pages. Two have four options:
1) Session variables
2) Page address parameters
3) Cookies
4) Database

The first is good, simple, and easy to use, but all data will be lost if the browser is closed or the connection broken, or timed out.

The second it simple, but looks messy as you add the items to your page redirect, in much the same way as google passes parameters:
www.mySite.com/myPage.aspx?1=12342&2=36345423

由于它显示在地址栏中,所以它不是一个好看的解决方案.

第三是将数据存储在客户端PC上的Cookie中-这意味着即使关闭计算机并明天再返回数据,这些数据也将保持不变.

确实需要将第四个选项与其他选项之一一起使用,以识别个人,或者需要注册并登录,然后客户才能购物.

如果可以,请使用Cookie.

然后,当您的客户按下购买"时,您将产品ID和数量添加到cookie中.
当他进入结帐页面时,您在接受具有约束力的购买这些物品"并要求付款之前,请先阅读Cookie列表并为他总结一下.

Since this shows in the address bar, it isn''t a good looking solution.

The third is to store the data in Cookies on the client PC - this means that teh data is persistent even if they turn off the PC and come back tomorrow.

The fourth really needs to be used with one of the other options to identify an individual, or to require registration and login before the customer can shop.

If you can, use cookies.

Then, when your customer presses "buy this" you add the product ID and the quantity to the cookies.
When he gets to the checkout page, you read back the cookies list and summarise it for him, before accepting a binding "Buy these" and asking for payment.


这篇关于asp.net vb脚本中的购物车的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆