October 2010
Intermediate to advanced
1920 pages
73h 55m
English
You can supply the ObjectDataSource control with a filter expression. The filter expression is applied to the data returned by the control’s select method. A filter is particularly useful when used in combination with caching. You can load all the data into the cache and then apply different filters to the cached data.
You learn how to cache data with the ObjectDataSource control in Chapter 29, “Caching Application Pages and Data.”
For example, the page in Listing 18.30 contains a DropDownList and GridView control. The DropDownList displays a list of movie categories, and the GridView displays matching movies (see Figure 18.8).
Figure 18.8. Filtering movies with the ObjectDataSource control.
Listing 18.30. ShowFilteredMovies.aspx ...