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: 11/1/2006 6:42:02 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 487 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
dwilliams459
Asp.Net User
Menu Control Horizontal Divider between certain Items.11/1/2006 6:42:02 PM

0

I am trying to add a divider such as a solid line between certain items in the Menu control.  Please see example.  Notice I have a horizontal line between the 2nd and 3rd item, but not the 1st and 2nd.  I could of course add an item to the site map with a title of "-------------"  but I would prefer a solid line such as a border-bottom: 1px,  or even a div tag that is 1px high with a background of black.   Is there any way to do this using css/spacer image?  I would rather not create a black divider gif that is 1px high x (say) 150px wide as some of the subMenus may be narower than others.  Thanks,
 Home Group
          SubItem1
          SubItem2
          --------------
          SubItem3
 

David Williams MCP
.Net Senior Developer
dwilliams459
Asp.Net User
Re: Menu Control Horizontal Divider between certain Items.11/2/2006 3:00:10 PM

0

I should add I have played with SeperatorImageURL property, which does allow me to add a seperator image between specific items in a submenu.  However I would like to bind the menu control to an XML file (or the sitemap), and I have not been able to successfully bind this value using SeperatorImageURLField property.  This property appears not to work when implementing binding against an XML (or sitemap) file.  Is it possible to do this without implmenting CSS Adapters (still beta, and I need for production).
 /* MenuSiteMap.xml:  */
<siteMapRootNode title="Home">
<staticNode title="Level1:1" url="home.aspx" >
<dynamic1Node title="Level2:1"  url="page1.aspx" SeparatorImageUrl="~/images/seperator150.gif" />
<dynamic1Node title="Level2:2"  url="page2.aspx" />
</staticNode>
</siteMapRootNode>

/* page.aspx: XMLDataSource for Menu Control */
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/MenuSiteMap.xml" XPath="/*/*"></asp:XmlDataSource>

/* Page.aspx: Databindings for Menu Control */
<DataBindings>
<asp:MenuItemBinding DataMember="staticNode" NavigateUrlField="url" TextField="title" />
<asp:MenuItemBinding DataMember="dynamic1Node" TextField="title" />
<asp:MenuItemBinding DataMember="dynamic1Node" SeparatorImageUrlField="SeparatorImageUrl" />
<asp:MenuItemBinding DataMember="dynamic1Node" NavigateUrlField="url" />
</DataBindings

David Williams MCP
.Net Senior Developer
dwilliams459
Asp.Net User
Re: Menu Control Horizontal Divider between certain Items.11/3/2006 1:29:08 PM

0

I was able to get this working by manually binding the SeperatorImageURL in the DataBound event.  I had to use a separator image though, in this case the separator image was 150px wide.  I still do not understand why the MenuItemBinding fields SeperatorImageURLField and ImageURLField do not work. 
 
OT: How would I implement this in CSS Adapters, specifically setting the style of specific Menu item to have a bottom border of 1px (Not all items in a menu level!).  I realize this in not the Adapters forum, but perhaps someone can provide a link to an example?  I looked at the white paper that came with the adapters tutorial and was overwhelmed.   
 
'Code to bind the Separator Image to a specific menu item from an XML file.  { Edit code is not working?? :(   }
Private Sub mnuControl_MenuItemDataBound(ByVal sender As Object, _
        ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles mnuControl.MenuItemDataBound
    Dim menuItem As MenuItem = CType(e.Item, MenuItem)
    Dim menuNode As XmlElement = CType(e.Item.DataItem, XmlElement)
    Dim SeperatorImageURL As XmlAttribute = menuNode.Attributes.ItemOf("SeparatorImageUrl")
    If SeperatorImageURL IsNot Nothing Then menuItem.SeparatorImageUrl = SeperatorImageURL.Value
End Sub

David Williams MCP
.Net Senior Developer
mkrivacek
Asp.Net User
Re: Menu Control Horizontal Divider between certain Items.5/28/2007 12:26:39 PM

0

I added this code to my page (in part where I'm builing menu dynamically in code - not using databinding):

MenuItem mnuSep = new MenuItem();

mnuSep.Selectable = false;

mnuSep.Text = "<hr size='1' />";

myMenu.ChildItems.Add(mnuSep);

and its working fine :-)

Michael

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


Free Download:

Books:
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Switching to the Mac: the missing manual Authors: David Pogue, Adam Goldstein, Pages: 508, Published: 2005
Mac OS X power tools Authors: Dan Frakes, Pages: 656, Published: 2004
Beginning Visual C# 2005 Authors: Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, Eric White, Pages: 1062, Published: 2005

Web:
Menu Control Horizontal Divider between certain Items. - ASP.NET ... I am trying to add a divider such as a solid line between certain items in the Menu control. Please see example. Notice I have a horizontal ...
Using menus and toolbars A horizontal menu has dividers between all items. You put dividers in ... tags have several attributes that let you easily control the menu appearance. ...
Visual Basic :: Vertical Divider In a lot of programs like Outlook and the VB design environment you can resize certain panels to set their ... ****Menu U Bar Divider Lines; MAIN Caused Divider Error ... if I can put up some horizontal divider lines between some menu items, .... Is there a custom control that allows me to put a vertical toolbar in ...
com.rational.test.ft.object.interfaces.flex (IBM Rational ... FlexButtonBarTestObject, The ButtonBar control defines a horizontal or vertical group of logically ... but it inserts draggable dividers in the gaps between the children. ... a horizontal, top-level menu bar that contains one or menu items. FlexMenuTestObject, The Menu control creates a pop-up menu of individually ...
CSS - Horizontal menu - Page 1 - JavaScriptBank.com SuckerTree Horizontal Menu is a CSS and DOM hybrid menu that's list based and supports .... The divider between the menu items is simply a white CSS border. ...

Menu Control Horizontal Divider between certain Items. - ng.asp ... I am trying to add a divider such as a solid line between certain items in the Menu control. Please see example. Notice I have a horizontal ...
horziontal menu control - items separator - ng.asp-net-forum ... Menu Control Horizontal Divider between certain Items. - ASP.NET ... I am trying to add a divider such as a solid line between certain items ...
Menu Divider or Seperator using CSS and or CSS adapters ... Menu Control Horizontal Divider between certain Items. - ASP.NET ... Is there any way to do this using css/spacer image? ...






problem in programmatically change the masterpages at runtime

asp.net 2.0 wizard control

changing hyperlinks color

dynamic stylesheet loads and server.transfer

page_error() in master page not firing

accessing label value using javascript and then manipulating that value

menu control-expanding child items cause browser scroll bars

how to control the text-size effects on the master page presentation

how to apply css to the insert link on a detailsview?

in my treeview i want all other parent nodes to contract when i expand a node

getting the user role from a master page

set active link in menu

exclude sitemap nodes on page level without writing custom provider?

accessing masterpage in usercontrol

position:fixed in ie6

navigateurl in the dynamic menu item ?

stop master page screen refresh on menu selection....please help...

menu popout image attributes

controls inside contentplaceholder have id's modified

menu control and current page

asp:menu very slow

body onblur='' with a masterpage

user.identity.isauthenticated doesn't work in master page

virtual earth in a masterpage

change menuitem image without postback

master page formatting issue

adding nodes to a sitemap at runtime

how to: expand tree to selectednode

gridview page flip: the file web.sitemap required by xmlsitemapprovider does not exist.

treeview collapse and expand dynamically

   
  Privacy | Contact Us
All Times Are GMT