One of the most common tasks you will encounter with using WebControls is populating their values from a data source. DropDownList, in particular, is one of the controls that most commonly needs to be populated from a data source of some kind. To wrap up this chapter, we're going to cover three different ways of populating DropDownList controls using ASP.NET. This example uses WebControls, but you could easily convert to using HtmlControls using the same syntax. The complete source code for the ASP page and codebehind is in Listings 5.3 and 5.4.
<%@ Page language="c#" ...