Previously always thought that the menu is made through Sitemap, recently saw the project in the method is to use the XmlDataSource list set.
MENUSITE.XLM file:
Copy Code code as follows:
<?xmlversion= "1.0" encoding= "Utf-8"?>
<menusvalue= "" >
<topmenuid= "value=" "Imageurl=" ~/app_themes/public/images/publicimages/topmenu_stl.jpg "NavigateUrl=" " >
<topmenuitemid= "value=" Applyforshorttermleaseofstateland "navigateurl=" ~/tol/issuance/ Apptolapplication.aspx "></TopMenuItem>
<topmenuitemid= "102" value= "Managemyexistingaccount" navigateurl= "~/caseenquiry/homeauthenticate.aspx"? Showpanel=true "></TopMenuItem>
<topmenuitemid= "value=" viewmessagesformyapplications "navigateurl=" ~/commonutility/email/ Listappcorrespondence.aspx "></TopMenuItem>
</TopMenu>
<topmenuid= "value=" "Imageurl=" ~/app_themes/public/images/publicimages/topmenu_aosl.jpg "NavigateUrl=" " >
<topmenuitemid= "value=" Managemyexistingstatetitle "navigateurl=" "></TopMenuItem>
<topmenuitemid= "203" value= "viewmessagesformyapplications" "Navigateurl=" "></TopMenuItem>
</TopMenu>
<topmenuid= "value=" "Imageurl=" ~/app_themes/public/images/publicimages/topmenu_lup.jpg "NavigateUrl=" " >
<topmenuitemid= "value=" Submitproposalforlanduse "navigateurl=" "></TopMenuItem>
</TopMenu>
<topmenuid= "value=" "Imageurl=" ~/app_themes/public/images/publicimages/topmenu_logout.jpg "NavigateUrl=" ~ "Logout.aspx" >
</TopMenu>
</Menus>
Create XmlDataSource and Asp:menu controls in HTML:
Copy Code code as follows:
<asp:xmldatasourceid= "XmlDataSource1" runat= "Server" datafile= "Menusite.xml" ></asp:XmlDataSource>
<asp:menudatasourceid= "XmlDataSource1" runat= "Server" id= "Menu1" maximumdynamicdisplaylevels= "4"
orientation= "Horizontal" staticdisplaylevels= "2" staticenabledefaultpopoutimage= "False"
Dynamicenabledefaultpopoutimage= "false" staticsubmenuindent= "" itemwrap= "True" >
<DataBindings>
<asp:menuitembindingdatamember= "Topmenu" imageurlfield= "ImageUrl" textfield= "value"
Navigateurlfield= "NavigateUrl" valuefield= "value"/>
<asp:menuitembindingdatamember= "Topmenuitem" navigateurlfield= "NavigateUrl" textfield= "value"
valuefield= "Value"/>
<asp:menuitembindingdatamember= "Menus" textfield= "value" valuefield= "value"/>
</DataBindings>
</asp:Menu>
menu is really comprehensive enough to set properties to meet your requirements without any code:
MaximumDynamicDisplayLevels: Specifies the number of dynamic display menu node layers that should be displayed after the static display layer. If set to 0, the child nodes will not display dynamic.
Orientation: Use to set a horizontal menu bar on the page.
StaticDisplayLevels: The number of layers of the menu that is displayed statically from the root menu. The trick here is that XML must have a root node, but when the menu is displayed, the second level of the menu item is displayed, so this
The root node value of the XML is set to NULL, and then saticdisplayleves to 2 so that the user sees the second level of static display.
Staticenabledefaultpopoutimage: The static menu item defaults to display with a small arrow, set to False, to modify this state.
Dynamicenabledefaultpopoutimage: Set whether dynamic display with small arrows.
Staticsubmenuindent: Controls show the indentation depth of submenu entries, if these menu levels are set to display in static mode.
Itemwrap: Sets whether the menu item can be wrapped.
The above settings make it easy to create the desired menu style.