The following example demonstrates how to populate a Menu control with static MenuItem objects using declarative syntax.
Visual Basic
<%@ Page Language="VB" %>
MenuItem Declarative Example
C#
<%@ Page Language="C#" %>
MenuItem Declarative Example
The following example demonstrates how to bind a Menu control to a SiteMapDataSource control. When bound to a data source, the Menu control automatically creates the MenuItem objects. For this example to work correctly, you must copy the sample site map data below to a file named Web.sitemap.
Visual Basic
<%@ Page Language="VB" %>
Menu DataBinding Example
C#
<%@ Page Language="C#" %>
Menu DataBinding Example
The following is sample site map data for the previous example.