Note that there are some explanatory texts on larger screens.

plurals
  1. POAsp.net Menu XML does not read properly
    primarykey
    data
    text
    <p>I am building my first asp.net app, I inserted the menu control (horizontal) and binded it to an XML file I made up. Unfortunately, when the page is rendered, the menu shows sub-items named as SubMenu, SubMenu, SubMenu and my text property isn't applied, also the links always points to #. I looked at other people's code online and I cannot spot the difference. Code:</p> <pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="OuterShell.master.cs" Inherits="OuterShell" %&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head runat="server"&gt; &lt;title&gt;&lt;/title&gt; &lt;link href="~/Styles/style1.css" rel="Stylesheet" type="text/css" /&gt; &lt;asp:ContentPlaceHolder id="HeadContent" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/head&gt; &lt;body&gt; &lt;form id="form1" runat="server"&gt; &lt;asp:Menu ID="Menu1" runat="server" DataSourceID="XmlDataSource1" Orientation="Horizontal" BackColor="#F7F6F3" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#7C6F57" StaticSubMenuIndent="10px"&gt; &lt;DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" /&gt; &lt;DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /&gt; &lt;DynamicMenuStyle BackColor="#F7F6F3" /&gt; &lt;DynamicSelectedStyle BackColor="#5D7B9D" /&gt; &lt;DynamicItemTemplate&gt; &lt;%# Eval("Text") %&gt; &lt;/DynamicItemTemplate&gt; &lt;StaticHoverStyle BackColor="#7C6F57" ForeColor="White" /&gt; &lt;StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" /&gt; &lt;StaticSelectedStyle BackColor="#5D7B9D" /&gt; &lt;/asp:Menu&gt; &lt;asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/menu_h.xml" EnableCaching="False"&gt;&lt;/asp:XmlDataSource&gt; &lt;div&gt; &lt;asp:ContentPlaceHolder id="MainContent" runat="server"&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>XML Code: </p> <pre><code>&lt;Main Text="Main Menu" url="~/Main.aspx"&gt; &lt;SubMenu Text="Start Configuring" url="~/Config1.aspx"&gt;&lt;/SubMenu&gt; &lt;SubMenu Text="About Us" url="~/About.aspx"&gt;&lt;/SubMenu&gt; &lt;SubMenu Text="Contact Us" url="~/Contact.aspx"&gt;&lt;/SubMenu&gt; &lt;/Main&gt; </code></pre> <p>Any help is appreciated. Thanks. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload