Modify the ShoppingCart applicationIn this exercise, you’ll modify and dịch - Modify the ShoppingCart applicationIn this exercise, you’ll modify and Việt làm thế nào để nói

Modify the ShoppingCart application

Modify the Shopping
Cart application
In this exercise, you’ll modify and enhance the Shopping Cart application that’s
in figures 8-13 and 8-14. Although the way this application works isn’t entirely
realistic, this exercise will give you a chance to use cookies, session state, and
caching.
Open, review, and run the Shopping Cart application
1. Open the Ex08Cart web site that’s in the aspnet45_cs directory, and review the code-behind files for the Order and Checkout pages to see that they’re like the ones in figure 8-14.
2. Test the application to see how it works. To go to the Checkout page, go first to the Cart page, then click its Checkout button. On the Checkout page, enter a first name and last name and click on the Continue button. Note that this displays the Order page with a Welcome message displayed.
3. Go back to the Checkout page, and note that the first name and last name fields are empty. Then, enter a different first name and last name and click on the Continue button to see that the Welcome message has been changed. Now, stop the application and return to Visual Studio.
4. Enable the trace feature for the Order page as shown at the bottom of figure 8-1. Next, run the application and scroll down to see the number of bytes used for view state. Then, turn the trace feature off.
Use cookies or session state to restore the data in the Checkout page
5. Modify the code-behind file for the Checkout page so the first and last name fields are restored when the user returns to this page by getting the data from the cookies that are created. Then, test this change. Remember, though, that the cookies have just a five minute life, so you may have to enter the first and last name fields again when you test this change.
6. Test this change again. This time, make sure that the Welcome message is correct if you change the entry in the first name field after it has been restored from the cookie. In other words, if you change the field from Mary to Mike, the Welcome message should reflect that.
7. Comment out the code for using cookies to restore the entries on the Checkout page. Then, write new code that uses session state to store the first and last name entries after the user enters them, and to restore those entries when the user returns to this page. This should also let the user change the values in the restored entries and have the changes be reflected in the Welcome message. Now, test this change.
Use caching to keep track of the hit count
8. In the code-behind file for the Order page, comment out the code that uses application state to keep track of the hit count. Then, write new code that uses caching to do that with a 5-minute life for the item, and test that change.
9. When you’re through testing and experimenting, close the application
0/5000
Từ: -
Sang: -
Kết quả (Việt) 1: [Sao chép]
Sao chép!
Modify the ShoppingCart applicationIn this exercise, you’ll modify and enhance the Shopping Cart application that’sin figures 8-13 and 8-14. Although the way this application works isn’t entirelyrealistic, this exercise will give you a chance to use cookies, session state, andcaching.Open, review, and run the Shopping Cart application1. Open the Ex08Cart web site that’s in the aspnet45_cs directory, and review the code-behind files for the Order and Checkout pages to see that they’re like the ones in figure 8-14.2. Test the application to see how it works. To go to the Checkout page, go first to the Cart page, then click its Checkout button. On the Checkout page, enter a first name and last name and click on the Continue button. Note that this displays the Order page with a Welcome message displayed.3. Go back to the Checkout page, and note that the first name and last name fields are empty. Then, enter a different first name and last name and click on the Continue button to see that the Welcome message has been changed. Now, stop the application and return to Visual Studio.4. Enable the trace feature for the Order page as shown at the bottom of figure 8-1. Next, run the application and scroll down to see the number of bytes used for view state. Then, turn the trace feature off.Use cookies or session state to restore the data in the Checkout page5. Modify the code-behind file for the Checkout page so the first and last name fields are restored when the user returns to this page by getting the data from the cookies that are created. Then, test this change. Remember, though, that the cookies have just a five minute life, so you may have to enter the first and last name fields again when you test this change.6. Test this change again. This time, make sure that the Welcome message is correct if you change the entry in the first name field after it has been restored from the cookie. In other words, if you change the field from Mary to Mike, the Welcome message should reflect that.7. Comment out the code for using cookies to restore the entries on the Checkout page. Then, write new code that uses session state to store the first and last name entries after the user enters them, and to restore those entries when the user returns to this page. This should also let the user change the values in the restored entries and have the changes be reflected in the Welcome message. Now, test this change.Use caching to keep track of the hit count8. In the code-behind file for the Order page, comment out the code that uses application state to keep track of the hit count. Then, write new code that uses caching to do that with a 5-minute life for the item, and test that change.9. When you’re through testing and experimenting, close the application
đang được dịch, vui lòng đợi..
Kết quả (Việt) 2:[Sao chép]
Sao chép!
Sửa đổi Shopping
Cart ứng dụng
Trong bài tập này, bạn sẽ thay đổi và tăng cường áp dụng Giỏ hàng đó là
trong con số 8-13 và 8-14. Mặc dù cách ứng dụng các công trình này không phải là hoàn toàn
thực tế, bài tập này sẽ cung cấp cho bạn một cơ hội để sử dụng các tập tin cookie, trạng thái phiên, và
bộ nhớ đệm.
Mở, xem xét, và chạy các ứng dụng Giỏ hàng
1. Mở trang web Ex08Cart đó là trong thư mục aspnet45_cs, và xem lại các tập tin mã phía sau cho trật tự và trang Checkout để thấy rằng chúng giống như những người thân trong hình 8-14.
2. Kiểm tra các ứng dụng để xem làm thế nào nó hoạt động. Để đi đến trang Checkout, đi đầu tiên để trang giỏ hàng, sau đó nhấp vào nút Thanh toán của mình. Trên trang Checkout, nhập một tên đầu tiên và cuối cùng tên và nhấp vào nút Tiếp tục. Lưu ý rằng điều này sẽ hiển thị các trang theo thứ tự với một thông điệp Chào mừng bạn hiển thị.
3. Quay trở lại trang Checkout, và lưu ý rằng tên đầu tiên và các lĩnh vực tên cuối cùng là trống rỗng. Sau đó, nhập một tên khác nhau và cuối cùng tên và nhấp vào nút Tiếp tục để thấy rằng thông điệp Chào mừng bạn đã được thay đổi. Bây giờ, chỉ việc áp dụng và trở về Visual Studio.
4. Kích hoạt tính năng dấu vết cho các trang theo thứ tự như hình ở dưới cùng của hình 8-1. Tiếp theo, chạy các ứng dụng và cuộn xuống để xem số lượng byte được sử dụng cho nhà nước xem. Sau đó, lần lượt các dấu vết đặc trưng ra.
Sử dụng cookie hoặc trạng thái phiên để khôi phục lại các dữ liệu trong các trang Checkout
5. Sửa đổi các mã phía sau tập tin cho các trang Checkout để các lĩnh vực tên đầu tiên và cuối cùng sẽ được phục hồi khi người dùng quay trở lại trang này bằng cách nhận được dữ liệu từ các tập tin cookie được tạo ra. Sau đó, kiểm tra sự thay đổi này. Hãy nhớ rằng, mặc dù, rằng các cookie chỉ có một cuộc sống năm phút, vì vậy bạn có thể phải nhập các lĩnh vực tên đầu tiên và cuối cùng một lần nữa khi bạn kiểm tra sự thay đổi này.
6. Kiểm tra sự thay đổi này một lần nữa. Lần này, hãy chắc chắn rằng thông điệp Chào mừng bạn là chính xác nếu bạn thay đổi các mục trong các trường tên đầu tiên sau khi nó đã được khôi phục từ các cookie. Nói cách khác, nếu bạn thay đổi các lĩnh vực từ Mary để Mike, thông điệp Chào mừng bạn nên phản ánh điều đó.
7. Thảo luận ra các mã cho sử dụng cookie để khôi phục lại các mục trên trang Checkout. Sau đó, viết mã mới có sử dụng trạng thái phiên để lưu trữ các mục tên đầu tiên và cuối cùng sau khi người dùng nhập vào họ, và để khôi phục lại những mục khi người dùng quay trở lại trang này. Điều này cũng sẽ cho phép người dùng thay đổi các giá trị trong các mục khôi phục và có những thay đổi được phản ánh trong thông điệp Welcome. Bây giờ, kiểm tra sự thay đổi này.
Sử dụng bộ nhớ đệm để theo dõi các hit đếm
8. Trong tập tin mã phía sau cho trang Order, nhận xét ​​ra các mã có sử dụng trạng thái ứng dụng để theo dõi các số trúng. Sau đó, viết mã mới sử dụng bộ nhớ đệm để làm điều đó với một cuộc sống 5 phút cho mục này, và kiểm tra sự thay đổi đó.
9. Khi bạn thông qua thử nghiệm và thử nghiệm, đóng ứng dụng
đang được dịch, vui lòng đợi..
 
Các ngôn ngữ khác
Hỗ trợ công cụ dịch thuật: Albania, Amharic, Anh, Armenia, Azerbaijan, Ba Lan, Ba Tư, Bantu, Basque, Belarus, Bengal, Bosnia, Bulgaria, Bồ Đào Nha, Catalan, Cebuano, Chichewa, Corsi, Creole (Haiti), Croatia, Do Thái, Estonia, Filipino, Frisia, Gael Scotland, Galicia, George, Gujarat, Hausa, Hawaii, Hindi, Hmong, Hungary, Hy Lạp, Hà Lan, Hà Lan (Nam Phi), Hàn, Iceland, Igbo, Ireland, Java, Kannada, Kazakh, Khmer, Kinyarwanda, Klingon, Kurd, Kyrgyz, Latinh, Latvia, Litva, Luxembourg, Lào, Macedonia, Malagasy, Malayalam, Malta, Maori, Marathi, Myanmar, Mã Lai, Mông Cổ, Na Uy, Nepal, Nga, Nhật, Odia (Oriya), Pashto, Pháp, Phát hiện ngôn ngữ, Phần Lan, Punjab, Quốc tế ngữ, Rumani, Samoa, Serbia, Sesotho, Shona, Sindhi, Sinhala, Slovak, Slovenia, Somali, Sunda, Swahili, Séc, Tajik, Tamil, Tatar, Telugu, Thái, Thổ Nhĩ Kỳ, Thụy Điển, Tiếng Indonesia, Tiếng Ý, Trung, Trung (Phồn thể), Turkmen, Tây Ban Nha, Ukraina, Urdu, Uyghur, Uzbek, Việt, Xứ Wales, Yiddish, Yoruba, Zulu, Đan Mạch, Đức, Ả Rập, dịch ngôn ngữ.

Copyright ©2025 I Love Translation. All reserved.

E-mail: