<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XmlDataBinding.aspx.cs" Inherits="XmlDataBinding" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>XML Data Binding </title>
    <link href="chapterStyles.css" type="text/css" rel="stylesheet"/>
    <style type="text/css">
          /* styles for the secondary menu down the left */
      .secondaryLevelOne
      {
         background-color: #647A90;
         margin: 1.5em 0 0 0;
         padding: 5px 0 0 5px;
         width: 10em; 
         height: 35px;
         color: #EDF2F8;
      }
      .secondaryLevelTwo
      {
         background: #90B2D5;
         padding: 5px 0 5px 5px;  
         color: #EDF2F8;       
      }
      .secondaryStaticHover
      {
         color: #800000;
      }
    </style>
</head>
<body>
    <form id="form1" runat="server">
      <div id="container">
      <h1>Przykład dołączania danych XML do Menu</h1>
      <p>Przykład pokazuje jak dołączać dane z pliku XML do kontrolki <code>Menu</code>.</p>
    

      <asp:Menu id="menuPrimary" runat="server" DataSourceID="xmlSource" 
        Orientation="Vertical"  StaticDisplayLevels="2" StaticSubMenuIndent="17"
        MaximumDynamicDisplayLevels="0" >

        <StaticHoverStyle CssClass="secondaryStaticHover"/>
        <LevelMenuItemStyles>
          <asp:MenuItemStyle CssClass="secondaryLevelOne" />
          <asp:MenuItemStyle CssClass="secondaryLevelTwo" />
        </LevelMenuItemStyles>
           
         <DataBindings>
          <asp:MenuItemBinding DataMember="Category" 
            TextField="Name"            
            ImageUrlField="Icon"
            />
          <asp:MenuItemBinding DataMember="Book" 
            TextField="Title"
            NavigateUrlField="#innerText"
            />
          
         </DataBindings>
         </asp:Menu>
        
         <asp:XmlDataSource id="xmlSource" runat="server"
           DataFile="menuMapping.xml" 
           XPath="/Books/Category"  /> 
      </div>
        
    </form>
</body>
</html>
