473,706 Members | 5,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with asp menu (background image of MenuItem)


I'm programmaticall y inserting a navigation asp menu to a page, like

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

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

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

// Set some Menu properties (css classes)
menu.Items.Add( mainItem);
menu.DisappearA fter = 250;
menu.Style.Clea r();
menu.StaticHove rStyle.CssClass = "StaticHoverSty le";
menu.StaticMenu ItemStyle.CssCl ass = "StaticMenuItem Style";
menu.StaticMenu Style.CssClass = "StaticMenuStyl e";
menu.DynamicHov erStyle.CssClas s = "DynamicHoverSt yle";
menu.DynamicMen uItemStyle.CssC lass = "DynamicMenuIte mStyle";
menu.DynamicMen uStyle.CssClass = "DynamicMenuSty le";
menu.Orientatio n = Orientation.Hor izontal;
menu.StaticEnab leDefaultPopOut Image = false;
menu.DynamicEna bleDefaultPopOu tImage = false;

return menu;
Basically each menu that gets returned (in above function) is a menu
with one menu item which look like this:

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:

..StaticMenuSty le
..StaticMenuIte mStyle
width: 110px;
height: 25px;
color: #5a5a5a;
font-size: 11px;
background-image: url(images/ButtonBasicActi ve.jpg);

Background image looks like this:
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 12015
..StaticMenuIte mStyle A:link
background-image: none;

is the solution...

Nov 16 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Derek Fountain | last post by:
I have a horizontal navigation bar, which is a single row table containing the right images. It "stretches" itself across the screen using a penultimate td like this: <td width="100%" background="images/nav_bar/nb_spacer.gif">&nbsp;</td> which works in all major browsers that I've tried, but doesn't validate. No background attribute to the td tag, apparently. What is the correct way to do this? A stylesheet entry with a
by: chris_culley | last post by:
Hi, I'm fairly new to using css, and have been using it to format a vertical navigation bar on my website, producing a load of buttons on top of each other, each with a (151 * 33 px) gif as the background. I've customised the <a> tag as follows: a.menu {
by: Andrew Poulos | last post by:
I'm working with one of those vertical menus that use CSS and lists. The menu is contained with a DIV (DIV.1) with a height of 100% that's within an absolutely positioned DIV (DIV.2). DIV.1 has a background image at "left bottom". If I set a fixed height for the DIV.2 the image appears correctly but if, as I need to do, calculate/set the height of the DIV.2 on window load then the image doesn't appear till one of the menu items are...
by: Littlefire | last post by:
Hi all I wrote a proxy script that fetches images out of a database and sends the data to the browser, using the Content-type header. For instance, if I'm loading a jpg image from the database, the script's output will be: header("Content-type: image/jpeg"); header("Content-length: <filesize-goes-here>"); print $imagedata;
by: H | last post by:
is it possible to add a background image to the menu items? I can add an image, but it displays on top of the text of the menu items. How can I add the image and still have the text in the foreground? Thanks... H
by: thallasridevi | last post by:
Hello, This is sridevi. I have a problem with background images. I am selecting the background images dynamially in my code and when a background image is selected, it is interfereing with the contents of body. Here what i want to do is: When a background image is selected it should not interfere with the contents of body. Anyone please help me in this regard. Waiting for your reply.
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of "background" or "background-image", the positioning only works with specifying pixels. If I specify the vertical position in pixels, the image gets cut-off at the bottom. I don't know what to do and would appreciate anyone's help. Specifically the code...
by: thephatp | last post by:
I'm having a problem with IE rendering correctly. I'm experimenting with using all div's in my pages now, and I'm not very familiar with the quirks of IE. I have created a sample page, and I'm really confused as to what is going on in IE. FF renders the page exactly as I expect. IE renders the page with everything in the correct location, but it seems to double the background image for a sub-div section that is moved up using a negative...
by: mahmoodn | last post by:
There is a problem with background image in my HTML file. I have written an HTML file and in that I add a background image. When I open it in firefox, it shows the background image but it does not work in IE and the background is empty. What is the problem?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.