473,668 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with asp menu (background image of MenuItem)

Hello!

I'm programmaticall y 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.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:
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:

..StaticMenuSty le
{
}
..StaticMenuIte mStyle
{
width: 110px;
height: 25px;
color: #5a5a5a;
font-family:Arial;
font-size: 11px;
background-image: url(images/ButtonBasicActi ve.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 12010
..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

5
116796
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
2
15551
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 {
1
1988
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...
1
2103
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;
2
5820
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
6
1288
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.
16
4926
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...
2
14067
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...
20
5159
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?
0
8378
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
jinu1996
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...
1
8577
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,...
0
7398
agi2029
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...
0
4202
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...
0
4376
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2786
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.