We may use data binding to fill lists with selectable items from an imported data source, like a database, an XML file, or a script.
Data Binding
The following controls are list controls which support data binding:- asp:RadioButtonList
- asp:CheckBoxList
- asp:DropDownList
- asp:Listbox
| <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> </html> |
By using an imported source, the data is separated from the HTML, and any changes to the items are made in the separate data source.
In the next three chapters, we will describe how to bind data from a scripted data source.
No comments:
Post a Comment