menu control in asp.net 2.0

i need a menu with multiple static items

Page 1 of 1

0 Replies - 2033 Views - Last Post: 29 June 2009 - 01:51 AM Rate Topic: -----

#1 sari563  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 09-April 07

menu control in asp.net 2.0

Posted 29 June 2009 - 01:51 AM

Quote

iam new to asp.net.

i need to create a menu with multiple static menu items using menu control binding with XMLDataSourse.


<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PublicMenu.ascx.cs" Inherits="UserControls_PublicMenu" %>
<asp:Menu ID="Menu1" runat="server" DataSourceID="XmlDataSource1" CssClass="IE8Fix" ForeColor="White" StaticEnableDefaultPopOutImage="False">
	
	<StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" BackColor="DarkRed" CssClass="menuItem" BorderColor="Gray" BorderStyle="Ridge" BorderWidth="2px" />
 <DynamicMenuStyle CssClass="IE8Fix" BackColor="White" />
		<DataBindings>
		<asp:MenuItemBinding DataMember="Home" />
		<asp:MenuItemBinding DataMember="Menu" />
		<asp:MenuItemBinding DataMember="SubMenu" NavigateUrlField="url" TextField="text"
			ValueField="text" />
	  </DataBindings>
	
	<LevelSelectedStyles>
						 <asp:MenuItemStyle Font-Underline="False" />
					 </LevelSelectedStyles>
					   <StaticMenuStyle BackColor="Transparent" />
					   <StaticSelectedStyle BackColor="#FFC080" />
					   <DynamicMenuItemStyle BackColor="PaleGoldenrod" CssClass="dynamicmenuitem" BorderColor="SaddleBrown" />
					   <StaticHoverStyle BackColor="Transparent" CssClass="dynamicmenuitemhover" ForeColor="#E0E0E0" />
					  <DynamicHoverStyle BackColor="Cornsilk" />
	 
  </asp:Menu>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/UserControls/PublicMenuXMLFile.xml">
</asp:XmlDataSource>









XMLDataSource

<?xml version="1.0" encoding="utf-8" ?>
<Home>  
  <Menu>
	<SubMenu text="JobSeekers" url="~/login.aspx"></SubMenu>
	<SubMenu text="Employer" url="~/login.aspx"></SubMenu>
	<SubMenu text="Admin" url="~/login.aspx"></SubMenu>
  </Menu>
  <Menu text="Search"  url="~/publicsearch.aspx"></Menu>

</Home>




Is This A Good Question/Topic? 0
  • +

Page 1 of 1