Strongly-Typed Binding for List Controls
I just published an article on the ASPAlliance covering the implementation of two types that can be used to bind list controls, such as the DropDownList, in a strongly-typed manner to a SQL Server data source using stored procedures. I think there is more potential in the idea than I have developed in the article, but I wanted to get it out there for comments from you.
I have already wrapped the usage in a caching class for a web application I'm working on, providing strongly-typed access to different menus with a usage like so:
Menus.StatusMenu.BindToListControl(myDDL)
Menus is a class exposing a static property of type NameValuePairCollection with an accessor that first tries to get the collection from the Cache object, if it exists, and to retrieve it from the database if it doesn't. In this way, I can access my menu data sources in a strongly-typed manner and use caching where appropriate.
Give it a whirl and let me know what you think.