ASP.NET Web Forms - XML File
We can bind an XML file to a list control.
An XML File
Here is an XML file named "countries.xml":
View this XML file:countries.xml
Binding a DataSet to a List Control
First, import the "System.Data" namespace. We need this namespace to work with the DataSet object. Include the following directive at the top of the .aspx page:
<%@ Import Namespace="System.Data" %>
Next, create a DataSet for the XML file, and load the XML file into the DataSet when the page is first loaded:
Then we add a subroutine that is executed when the user clicks an item in the RadioButtonList control. When a radio button is clicked, a line of text appears in the label:
Example
<%@ Import Namespace="System.Data" %>
Demo Example »