In this topic, you will learn how to bind the C1NavigationList control to an XML data source. This topic assumes that you have created an AJAX-enabled ASP.NET project that contains a ScriptManager control (see Creating an AJAX-Enabled ASP.NET Project) and a C1NavigationList control.
Complete the following steps:
1. In Solution Explorer, right-click the project to open its context menu and select Add New Item.
The Add New Item dialog box appears.
2. Select SiteMap from the templates list and click OK to add the site map file to your project.
3. Replace the markup in the site map file with the following markup:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<menuitem Text="Menu item 1" Value="1" IsSeparator="0">
</menuitem>
<menuitem Text="Separator on" Value="SeparatorOn" IsSeparator="on">
</menuitem>
<menuitem Text="Menu item 2" Value="2" IsSeparator="false">
<menuitem Text="Menu item" Value="2" IsSeparator="false">
<menuitem Text="Menu item 1" Value="1" IsSeparator="false">
</menuitem>
<menuitem Text="Menu item 2" Value="2" IsSeparator="false">
</menuitem>
<menuitem Text="Menu item 3" Value="3" IsSeparator="false">
</menuitem>
</menuitem>
</menuitem>
<menuitem Text="Text">
</menuitem>
<menuitem Text="Menu item 3" Value="3" IsSeparator="false">
<menuitem Text="Menu item" Value="1" IsSeparator="false">
</menuitem>
<menuitem Text="Menu item" Value="3" IsSeparator="false">
</menuitem>
</menuitem>
</root>
4. Return to the .aspx page and click the Design tab to enter Design view.
5.
Click C1NavigationList's
smart tag () to open the
C1NavigationList Tasks menu.
6. Click the Choose Data Source drop down and select New data source.
The Data Source Configuration Wizard dialog box opens.
7. Select XML and then click OK.
The Configure Data Source dialog box opens.
8. In the Configure Data Source dialog box, click the Browse button next to Data File to open the Select XML File dialog box.
9. Select your XML file and press OK to close the Select XML File dialog box.
10. Press OK to close the Configure Data Source dialog box.
11. Save the project and open it in a Studio for iPhone-compatible browser. Observe that the XML data source has populated the C1NavigationList control's item list.