ASP. NET data binding
We can use data binding to fill the list of optional items from imported data sources, such as a database, an XML file, or a script.
Data Binding
The following Control Lists support data binding:
Dynamic: RadioButtonList
Dynamic: CheckBoxList
Dynamic: drop-down list
Dynamic: list box
The ListItem control is usually defined on one or more pages in each of the preceding controls of an optional project, as shown in the following code:
<Html> <body>
<Form runat = "server"> <asp: RadioButtonList id = "countrylist" runat = "server"> <asp: listItem value = "N" text = "Norway"/> <asp: ListItem value = "S" text = "Sweden"/> <asp: listItem value = "F" text = "France"/> <asp: ListItem value = "I" text = "Italy"/> </asp: RadioButtonList> </form>
</Body>
However, for data binding, we may use a separate source, such as a database,
An XML file or script to fill the list of optional projects.
By using the import source, the data is separated by HTML, and any changed items are in a separate data source.
The following three chapters describe how to bind data to a data source script.