TAILIEUCHUNG - ASP.NET 4 Unleased - p 139

Khi bạn chèn một bộ phim mới vào cơ sở dữ liệu, phương pháp () được gọi để loại bỏ các trang từ bộ nhớ cache. Bởi vì phương pháp này chỉ chấp nhận một "ảo tuyệt đối" con đường, các () phương pháp chuyển đổi các dấu ngã vào con đường ứng dụng gốc. | 1354 CHAPTER 29 Caching Application Pages and Data T hr asp GridView id grdMovies DataSourceID srcMovies Runat server asp SqlDataSource id srcMovies ConnectionString ConnectionStrings Movies SelectCommand SELECT Title Director FROM Movies Runat server br br a href Add Movie a div form body html The page in Listing contains a DetailsView control that enables you to add a new movie. When you insert a new movie into the database the method is called to remove the page from the cache. Because this method accepts only a virtual absolute path the method converts the tilde into the application root path. LISTING @ Page Language C DOCTYPE html PUBLIC - W3C DTD XHTML Transitional EN http TR xhtml1 DTD script runat server protected void dtlMovie_ItemInserted object sender DetailsViewInsertedEventArgs e script html xmlns http 1999 xhtml head id Head1 runat server title Add Movie title From the Library of Wow eBook Using Page Output Caching 1355 head body form id form1 runat server div h1 Add Movie h1 asp DetailsView id dtlMovie DefaultMode Insert DataSourceID srcMovies AutoGenerateRows false AutoGenerateInsertButton true Runat server OnItemInserted dtlMovie_ItemInserted Fields asp BoundField DataField Title HeaderText Title asp BoundField DataField Director HeaderText Director Fields asp DetailsView asp SqlDataSource id srcMovies ConnectionString ConnectionStrings Movies InsertCommand INSERT Movies Title Director VALUES @Title Director Runat server div form body html 29 The method enables you to remove only one page from the cache at a time. If you need to remove multiple pages you can create a key dependency which enables you to create a dependency between one item in the .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.