Great work on the Adapters. I am attempting to create a menu with separator via CSS between specific items. Please refer to http://forums.asp.net/thread/1449615.aspx for more detail with regards to plain (non css adapted) menus. Is it possible using CSS adapters to specify a divider or separator between specific menu items, preferably using styles/css such as a border-bottom: 1px or even a 1 px high span/div tag with a background color? Please note I don't want to apply this to all items in the menu, just specific ones. Can this be done through modifying css classes, or would the adapter code need to be modified. I am new to CSS adapters, perhaps someone can please point me in the right direction? Thanks! Example:SubMenuMenuItem 1MenuItem 2----------------- < Preferably a style/css, not an image
MenuItem 3MenuItem 4
David Williams MCP
.Net Senior Developer
![]() |
0 |
![]() |
Scott Guthrie's Blog entry at http://weblogs.asp.net/scottgu/archive/2006/05/02/CSS-Control-Adapter-Toolkit-for-ASP.NET-2.0-.aspx was very helpful in helping me navigate through the menu adapters code. In looking at the CSS Adpaters Tutorial, I see I can modify the App_Code/Adapters/MenuAdapters.vb - BuildItem method. I can append another css class to those already applied such as " ASP-Net-Divider", and specify the styles for this divider class in the CSS/Menu.css or the file.
David Williams MCP
.Net Senior Developer
![]() |
0 |
![]() |
I don't know if this will help you but I got seperators to work with a sitemap. You can still customize the <hr /> tag with css if needed.
<?
xml version="1.0" encoding="utf-8" ?><siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="">
<siteMapNode url="MenuItem1.aspx" title="Menu Item 1" description="Menu Item 1 description" />
<siteMapNode url="MenuItem2.aspx" title="Menu Item 2" description="Menu Item 2 description" />
<siteMapNode title="<hr />" />
<siteMapNode url="MenuItem3.aspx" title="Menu Item 3" description="Menu Item 3 description" />
<siteMapNode url="MenuItem4.aspx" title="Menu Item 4" description="Menu Item 4 description" />
</siteMapNode>
</siteMap>
![]() |
0 |
![]() |
If this is something that is going to be considered, particularly for horizontal menus, possible consideration might be given to being able to use any ASCII character to separate the adjacent links. The ability to apply a CSS style so that the characters could be hidden would also be advantageous.
Such a thing would satisfy the W3C Accessibility Guideline 1.0, Priority 3, 9.5 -- "Separate adjacent links with more than white-space." Border attribute via style sheet is not enough to satisfy this requirement. A few designers might appreciate the ability, for example, to add a horizontal bar between menu items.
![]() |
0 |
![]() |
Disregard the above. The Priority 3, Section 9.5 of the Guidelines are met and do not need an ASCII character between the links. The horizontal menu is rendered inline by the style sheet. Since a Braille reader doesn't interpret style sheets, the menu links are separated by a line return, bullet, whatnot, by virtue of the unordered list definition. Apologies for any confusion.
Thanks for the sitemap node title suggestion of <hr /> for a horizontal rule separator. An additional alternative for those who want to add a style to an ASCII character to the specific separator would be: <siteMapNode title="<span class='Specific_Class_Name'>|</span>"/> You can define the class of the span to format the ASCII, in this case a vertical bar, character. Sort of down and dirty but it works and validates. Just keep in mind that when style sheets are disabled, the separator will render as a list item.
![]() |
0 |
![]() |