Home All Groups Group Topic Archive Search About

Problem with asp menu (background image of MenuItem)

Author
16 Nov 2006 11:42 AM
sthrudel
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?

AddThis Social Bookmark Button