tailieunhanh - Creating a Simple Shopping Cart Application

Creating a Simple Shopping Cart Application In this section, you'll modify your DataGridWebApplication you created earlier to turn it into a simple shopping cart. | Creating a Simple Shopping Cart Application In this section you ll modify your DataGridWebApplication you created earlier to turn it into a simple shopping cart. You ll store the shopping cart in a Session object. Note As mentioned in the previous section in a real application you ll probably want to store the shopping cart in the database rather than in a Session object. Figure shows the final running form that you ll build. You use the Buy button to add a product to the shopping cart shown on the right of the form. As you can see from Figure I ve added three products to the shopping cart by pressing the Buy button for each product in the grid on the left. Figure The running form You can either follow the steps shown in the following sections to add the Buy button and the shopping cart to your form or you can replace the code in your form with the code in the file contained in the VS .NET Projects DataGridWebApplication directory. You replace the code in your form by selecting and deleting the existing code in your form and pasting in the code from the file. You ll also need to replace the code behind your form with the code in the file contained in the VS .NET Projects DataGridWebApplication directory. Adding the Buy Button In this section you ll add the Buy button to the DataGrid1 object of the DataGridWebApplication. Perform the following steps 1. Open DataGridWebApplication by selecting File Open Project double-click the Data-GridWebApplication folder and double-click the file. 2. Open the file in Design mode by double-clicking this file in the Solution Explorer window. Click on the DataGridl control in the form. Figure shows the properties for DataGridl. Figure DataGridl properties 3. Next click the Property Builder link near the bottom of the Properties window. Do the following to add the Buy button 1. Click Columns on the left of the .

TÀI LIỆU LIÊN QUAN
10    158    1
6    184    1
7    162    1
5    157    1
6    160    1
6    152    1
6    150    1
6    206    1
7    154    1
5    121    1