471,582 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 software developers and data experts.

Problem with asp menu (background image of MenuItem)

Hello!

I'm programmatically inserting a navigation asp menu to a page, like
this:

// Create new Menu
Menu menu = new Menu();

// Create new MenuItem
MenuItem mainItem = new MenuItem();
mainItem.Text = _text;
mainItem.Selectable = false;

// Fill the MenuItem with ChildItems
for (int i = 0; i < _entries.Count; i++)
{
mainItem.ChildItems.Add(_entries[i].CreateControl());
}

// Set some Menu properties (css classes)
menu.Items.Add(mainItem);
menu.DisappearAfter = 250;
menu.Style.Clear();
menu.StaticHoverStyle.CssClass = "StaticHoverStyle";
menu.StaticMenuItemStyle.CssClass = "StaticMenuItemStyle";
menu.StaticMenuStyle.CssClass = "StaticMenuStyle";
menu.DynamicHoverStyle.CssClass = "DynamicHoverStyle";
menu.DynamicMenuItemStyle.CssClass = "DynamicMenuItemStyle";
menu.DynamicMenuStyle.CssClass = "DynamicMenuStyle";
menu.Orientation = Orientation.Horizontal;
menu.StaticEnableDefaultPopOutImage = false;
menu.DynamicEnableDefaultPopOutImage = false;

return menu;
Basically each menu that gets returned (in above function) is a menu
with one menu item which look like this:
http://www.kizej.com/~primozh/x/image.bmp

If you look closely, you see that the background of the text is
basically the background of the MenuItem. WHY is this happening?
Here is the CSS:

..StaticMenuStyle
{
}
..StaticMenuItemStyle
{
width: 110px;
height: 25px;
color: #5a5a5a;
font-family:Arial;
font-size: 11px;
background-image: url(images/ButtonBasicActive.jpg);
}

Background image looks like this:
http://www.kizej.com/~primozh/x/ButtonBasicActive.jpg
Can anyone tell me why is the background image of the text the same as
the background image of the MenuItem?

Nov 16 '06 #1
1 11916
..StaticMenuItemStyle A:link
{
background-image: none;
}

is the solution...

Nov 16 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Derek Fountain | last post: by
1 post views Thread by Andrew Poulos | last post: by
1 post views Thread by Littlefire | last post: by
16 posts views Thread by stevedude | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.