CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/24/2008 8:34:47 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 294 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
slasi.net
Asp.Net User
How To add " | " seperator into Horizontal menu3/24/2008 8:34:47 PM

0

Hi,

 i am trying to add " | " seperation between the menu items,

here is what i do:

 

   <asp:Menu id= "TopMenu" runat="server" OnMenuItemDataBound="TopMenu_MenuItemDataBound" DataSourceID="SiteMapDataSourceTopMenu" Orientation="Horizontal" StaticDisplayLevels="3" DynamicVerticalOffset="2" PathSeparator=" | " Height="20"> 

<DynamicItemTemplate>| <asp:Label ID="Label2" runat="server" Font-Names="Tahoma" ForeColor="Black"

Text='<%# Eval( "Text" ) %>'>

</asp:Label>

&nbsp;&nbsp;&nbsp;&nbsp;

</DynamicItemTemplate>

</asp:Menu>

<asp:SiteMapDataSource ID="SiteMapDataSourceTopMenu" SiteMapProvider="TopMenuSiteMap" runat="server" />

 
  
 

When i run it it doesnt changing the static displaylevels to StaticDisplayLevels="3" doesnt help.

 Any idea how sould i get it work ? 

thanks for the help

 Ori

 

awd_envy
Asp.Net User
Re: How To add " | " seperator into Horizontal menu3/24/2008 9:12:26 PM

0

I ususally use something like.... as only the top Static portion can use a separator.

<asp:Menu runat="server"  StaticTopSeparatorImageUrl="~/images/Menu_Seperator_Image.png">
</asp:Menu>

 

and my Image looks like a  " | " image. 

jdaresta
Asp.Net User
Re: How To add " | " seperator into Horizontal menu3/24/2008 9:48:02 PM

0

Below is simple or cheap approach I took when I wanted to do this. Note I only did this at the first level nodes of the site map, but you could easily expand this subsequent levels by sending the node or searching for the node in the tree.

First the ASP.NET code. Note the CheckForSeparator call.

                    <asp:Menu ID="menuMain" runat="server" Orientation="Horizontal" DataSourceID="KOH_SiteMapDataSource" MaximumDynamicDisplayLevels="0" OnMenuItemDataBound="menuMain_MenuItemDataBound" >
                    <StaticItemTemplate>
                        <asp:HyperLink ID="hlMenuLink" runat="server" Text='<%# Eval("Text") %>' NavigateUrl='<%# Eval("NavigateUrl") %>' ToolTip='<%# Eval("ToolTip") %>' CssClass="LabelBold" /><%# CheckForSeparator(((MenuItem)Container.DataItem).Text) %>
                    </StaticItemTemplate>
                    </asp:Menu>

 Then the code behind.

        /// <summary>
        /// Used when binding main menu to see if a | separator should be added at the end.
        /// </summary>
        /// <param name="MenuText"></param>
        /// <returns></returns>
        protected string CheckForSeparator(string MenuText)
        {
            if (SiteMap.RootNode.ChildNodes.Count > 0)
            {
                if (SiteMap.RootNode.ChildNodes[SiteMap.RootNode.ChildNodes.Count - 1].Title.ToLower() != MenuText.ToLower())
                {
                    return " | ";
                }
                else
                {
                    return "";
                }
            }
            else
            {
                return "";
            }
        }
 

 

slasi.net
Asp.Net User
Re: How To add " | " seperator into Horizontal menu3/24/2008 9:56:04 PM

0

Thanks for the posts, both wais are working.

 meny thanks

 

Ori

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning REALbasic: From Novice to Professional Authors: Jerry Lee Ford, Pages: 372, Published: 2006
Dreamweaver MX extensions Authors: Laura Gutman, Pages: 523, Published: 2002
The Definitive Guide to Java Swing Authors: John Zukowski, Pages: 899, Published: 2005
Sams teach yourself Macromedia Dreamweaver 4 in 24 hours Authors: Betsy Bruce, Pages: 450, Published: 2000
Java Swing Authors: Marc Loy, Robert Eckstein, Dave Wood, Brian Cole, James Elliott, Pages: 1252, Published: 2002

Web:
How to add seperators in horizontal menu control? - ASP.NET Forums I am making a horizontal menu using ASP.NET Menu control. They don't have any child menu items. And I want to add seperators between menu items. ... 10: Live Search Cashback & Live Search Products Combined into New Site ...
Add Separators In Submenus Of Horizontal Dropdown Menu How can I add the separator to the submenus of my horizontal dropdown menu? ... Apr 05, 2007 - How to integrate your pull down menu code into Microsoft ...
Separator Image If you want to specify a different height in the horizontal, making the separator, [image or line] not go the complete height of the menu, ...
Adding a horizontal separator to a Flex PopUpButton control's pop ... In a previous example, “Adding a horizontal separator to a Flex PopUpButton control's pop up menu”, we saw how you could add a horizontal separator to a ...
How to Use Separators (The Java™ Tutorials > Creating a GUI with ... The JSeparator class provides a horizontal or vertical dividing line or empty space. ... The code to add the menu items and separators to the menu is extremely ... The insertSeparator method inserts the separator into the menu at the ...

How To add " | " seperator into Horizontal menu - ng.asp-net-forum ... How To add " | " seperator into Horizontal menu, > ROOT > NEWSGROUP > Asp.Net Forum ...
Menu Divider or Seperator using CSS and or CSS adapters ... Menu Control Horizontal Divider between certain Items. ... How To add " | " seperator into Horizontal menu - ng.asp-net-forum . ...
ASP:Menu Orientation - ng.asp-net-forum ... How To add " | " seperator into Horizontal menu - ng.asp-net-forum ... Menu Control: Adding pipes (|) in between menu items...? - ng.asp . ...
Menu Control: Adding pipes (|) in between menu items...? - ng.asp ... Of course, I created a horizontal menu with static items. ... programatically check for the first item in the set without getting into the code beside, ... NET 2.0 menu seperator Hi, I'm using a menu control that uses a ...
Using Css with the Menu Control - ng.asp-net-forum ... I am trying to add a simple asp:menu to my webpage and use stylesheets to make it look nice. ... Menu Divider or Seperator using CSS and or CSS adapters . ... Menu Control Horizontal Divider between certain Items. ... Add your menu through the menu manager. Log in to the administrator panel, ...






clean xhtml code with asp.net 2.0 controls

inefficient themes applied by css: web part zones

themes

navigation menus

menu control simulating sitemappath

staticselectedstyle for a menu control

menu control questions

app built with master page having rendering issues on postback

site map structure question

treeview sitemap, control expand / collapse

clinet side scriptin in master pages using javascript

treeview and javascript

need help on creating a dynamic page. - we use master pages and this is how i am trying to accomplish it.

tree view sitemap nodes

how to override master events?

repainting master page after page has been loaded

menu control

skinid property is disabled

trouble with master page

virtual directory

creating a footer using web.sitemap

sitemappath & menu bar(navigation)

button click event

virtual path provider

access a controlparameter for formview placed in a contentplaceholder?

treeview xml datasource on the fly

what i see is not what i get!!! (cell's borders and css styles)

add atribute to menu's items(asp.net2)

theform undefined

theme, master page

   
  Privacy | Contact Us
All Times Are GMT