October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can use the CacheControlPolicy.Dependency property to create a dependency between a cached User Control and a file (or set of files) on the file system. When the file is modified, the User Control is dropped from the cache automatically and reloaded with the next page request.
For example, the User Control in Listing 29.25 displays all the movies from the Movies.xml file in a GridView control. The User Control includes a Page_Load() handler that creates a dependency on the Movies.xml file.
Listing 29.25. MovieFileDependency.ascx

The code download on the website that accompanies this book includes ...
Read now
Unlock full access