Latest web development tutorials

ASP.NET data binding

We can use data binding (Data Binding) can be accomplished with a list of options, these options can be imported from a data source, such as a database, XML file, or script.

Data Binding

The following is a list of supported controls controls data binding:

  • asp: RadioButtonList
  • asp: CheckBoxList
  • asp: DropDownList
  • asp: Listbox

Above each control option it is usually in one or more asp: ListItem controls are defined as follows:


<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" />


However, we can use some independent data source for data binding, such as a database, XML file, or script, by data binding to populate the list of available options.

By using the imported data source, the data is separated from the HTML out, and modifications to options are completed in a separate data source.

In the three chapters that follow, we will describe how to bind data from a scripted data source.