Beginning ASP.NET 2.0 With CSharp (2006) [eng]
.pdf
13
E-Commerce
This is the first version of this book that’s ever dared to talk about e-commerce. This isn’t because we’ve forgotten to, or because we think it’s unimportant, but mainly because this is the first version of ASP.NET where it hasn’t been too complicated to even think about. I must admit it’s the one area as a developer that even I (or any developer) will tread very carefully. The reason is simple — money. When you’re handling other people’s money, you really must make every effort to ensure that nothing can go wrong. If not, you, or the company you work for, could be held responsible and personally liable for every penny lost or stolen.
If you’re not frightened off by that rather stern introduction, then I must hasten to add that there has never been a better time for building e-commerce functionality into your applications. By e- commerce I’m using an all-embracing term, because e-commerce covers a multitude of features. In fact, it extends over the entire process of buying and selling an item on the web. If you consider what happens when you visit a site such as Amazon, with an intention to purchase something, there are several stages. First is the product catalog that displays the list of items from which you want to make a purchase. After you choose an item, it is moved into your shopping cart. You can continue shopping and add more items, and when you finish, you check out. After you check out, your order has to be processed. These kinds of questions have to be answered when order processing: Is your item in stock? How long will it take to order if it isn’t? Where should it be delivered? Next comes the bit we all hate: getting the credit card out and supplying details, checking that the number is valid, and the dates. The whole transaction should be secure. Then you get a summary and maybe an e-mail containing the details of the sale. ASP.NET 2.0 introduces a terrific range of controls to help you build a workable e-commerce solution for any web site.
Of course it isn’t possible to fully model every step of this process in just one chapter, and as with web services, entire books are devoted to this subject. Also, it isn’t practical to set up a credit card–handling facility for the sake of testing one chapter. However, with the new components that ASP.NET 2.0 brings, you can create a product catalog, a shopping cart, and a checkout system; update the stock details and product catalog; get users to enter their details; and see how you would handle real credit card details. This should give you a strong overview of how you can add the capability to buy and sell items from your web site, and although it is something to be wary of and treated very seriously, it isn’t something to be scared of adding, because ASP.NET 2.0 makes it simpler than ever before.
