October 2010
Intermediate to advanced
1920 pages
73h 55m
English
ObjectDataSource ControlIf you discover that you are declaring an ObjectDataSource control with the same properties on multiple pages, it makes sense to derive a new control from the ObjectDataSource control that has these properties by default. That way, you can simply declare the derived control in a page.
For example, if you display a list of movies in multiple pages in your website, it would make sense to create a specialized MovieDataSource control.
The control in Listing 18.40, named the MovieDataSource control, derives from the base ObjectDataSource control class. The MovieDataSource control represents the MoviesComponent, which is also contained in Listing 18.40.
Listing 18.40. MovieDataSource.cs
The MovieDataSource ...
Read now
Unlock full access