ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 307,148 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 1,730 people online right now. Registration is fast and FREE... Join Now!




menu control in asp.net 2.0

 

menu control in asp.net 2.0, i need a menu with multiple static items

sari563

29 Jun, 2009 - 12:51 AM
Post #1

New D.I.C Head
*

Joined: 9 Apr, 2007
Posts: 6


My Contributions
QUOTE



iam new to asp.net.

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



CODE

<%@ 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

CODE
<?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>




User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 04:03PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month