TAILIEUCHUNG - Microsoft ASP .NET Fast & Easy Web Development phần 8

Theo mặc định, thư mục Tài liệu tham khảo có chứa tham chiếu đến , , , dll, và các tập tin . Các tập tin có chứa các siêu dữ liệu cho các hội đồng cần thiết cho một dịch vụ Web. Siêu dữ liệu này bao gồm các thông tin như tên | the Location attribute is set to Any which enables applications to cache data on any client-enabled device. However if you want to use a specific device for caching data you can specify Client Downstream or Server. If you do not want caching enabled for a Web form you can specify the value None. VaryByParam. Consider a scenario in which you have enabled caching for a Web form . The Web form accepts the article ID from the query string and retrieves data for the article. When the page is requested for the first time the article with ID 1 is loaded. This page will be cached. If another user requests the same form with article ID 2 the cached page will not be loaded because the cache represents the article with ID 1. To avoid loading cached data when the value passed in the query string is different you can specify the query string key in the VaryByParam attribute. Therefore in this case you should specify ArticleID for the VaryByParam attribute. To implement page-output caching use the page of the MySourceCode application. See Chapter 10 Managing Data from Applications for more information on how the page was created. Ofkih Ariĩlo TtpK pagflj I kdri ici n IWRnlrpy-JwrP L b ThK lahil dtsplayi ĩhp rim when the page k idfl i Trw hibri hirt beer- added Silly líi W rhA page w befr g cached MỉCcesdu y Afr r caching has mphrrtflrtled lw l delate th In the Load event of the form specify the following line of code to show the current time in the lblRefreshTime label. After you add the label you need to add the @ OutputCache directive to the form. 1. Click on the HTML tab to switch to the HTML view of the form. 2. Add the @ OutputCache directive as shown here. The form will be cached for two minutes. If the same article is loaded before the two minutes has elapsed the time displayed in the lblRefreshTime label will .

TỪ KHÓA LIÊN QUAN
Đã 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.