Đang chuẩn bị liên kết để tải về tài liệu:
Creating a Simple Shopping Cart Application

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

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 15.24 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 15.24 I ve added three products to the shopping cart by pressing the Buy button for each product in the grid on the left. Figure 15.24 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 ASP.NET code in your form with the code in the WebForm1.aspx 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 WebForm1.aspx file. You ll also need to replace the code behind your form with the code in the WebForm1.aspx.cs 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 DataGridWebApplication.sln file. 2. Open the WebForml.aspx file in Design mode by double-clicking this file in the Solution Explorer window. Click on the DataGridl control in the form. Figure 15.25 shows the properties for DataGridl. Figure 15.25 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.