TAILIEUCHUNG - 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 .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.