CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting – 3 Months Free!



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 3/6/2007 10:36:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 13 Views: 96 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
14 Items, 1 Pages 1 |< << Go >> >|
whatispunk
Asp.Net User
Dynamic menu background always white3/6/2007 10:36:59 PM

0/0

No matter what I do I cannot seem to make the dynamic menu background anything other than white. I have tried setting every single background attribute to Transparent both via the markup attributes and using CSS but no luck.

When I view the page source I see that the following inline style has been created:
.ctl00_Menu1_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }

No matter what I change this style's background-color seems to be fixed on white.

Any help would be greatly appreciated!


Simple minds think alike. Great minds come up with something different.
etws14
Asp.Net User
Re: Dynamic menu background always white3/7/2007 4:41:21 AM

0/0

can you show the menu control html source and your css file related to the menu control?

whatispunk
Asp.Net User
Re: Dynamic menu background always white3/7/2007 1:50:25 PM

0/0

Here's the code: Here's the CSS: ..menuLevel1 { background: url(Images/button1.png) top left no-repeat; background-color: Transparent; padding: 0 3px; height: 48px; width: 145px; margin: 2px 0; color: White; font-variant: small-caps; font-size: medium; font-weight: bold; } ..menuLevel1 a {background: transparent;} ..menuLevel2 { color: Black; font-family: Gill Sans MT !important; font-size: medium; background-color: Green !important; border: dashed 1px silver; margin: 2px 2px; width:100%; height:35px; } ..menuStaticHover { font-size:large; } ..menuDynamicHover { color: red; background-color: Black !important; } ..menuDynamic { background-color:Transparent !important; }
Simple minds think alike. Great minds come up with something different.
whatispunk
Asp.Net User
Re: Dynamic menu background always white3/7/2007 2:00:24 PM

0/0

Urge to kill rising!! Okay, I feel like a total no0b right now. It's not like I've never used a forum before! When I am trying to make a new post, on the Compose tab I cannot simply type in the Message zone. I have to open the HTML editor in order to type anything. I have tried changing the Content Editor setting in the Site Options and both Enhanced and Standard cause this behavior. The only one that seems to work is Plain Text. But then we get results like my above post with no carriage returns and no ASP code. I tried to simply paste in my ASP code but it didn't show up in the final post. Someone please help me. My god this is embarrasing!
Simple minds think alike. Great minds come up with something different.
etws14
Asp.Net User
Re: Dynamic menu background always white3/7/2007 2:31:36 PM

0/0

if not miss taken the one you gave at began it is has assigned by default.

background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px;

I still haven't find the way to clear it

Adam.Kahtava
Asp.Net User
Re: Dynamic menu background always white3/7/2007 2:39:35 PM

0/0

What does your menu definition look like? Can you set the BackColor through the ASP.NET style attributes?

Example:

<asp:Menu runat="server" BackColor="#A2ABB0"

... 


-Adam Kahtava [http://adam.kahtava.com]
whatispunk
Asp.Net User
Re: Dynamic menu background always white3/7/2007 3:00:26 PM

0/0

Honestly, I would LOVE to post my ASP code but this forum is not allowing me to. I'm only able to edit the text of a post in Plain Text mode or using the HTML Editor in Enhanced or Standard mode. And in either mode, when I paste in the code, it doesn't show up in the final post. Oh and carriage returns don't seem to exist. Here, I will add 5 new lines right here >
Simple minds think alike. Great minds come up with something different.
whatispunk
Asp.Net User
Re: Dynamic menu background always white3/7/2007 3:10:47 PM

0/0

Okay here is my code. I had to escape all the greater than less thans to make it friggin post properly. Is that normal? Anyways, on with the show:


<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1" DynamicHorizontalOffset="1" Width="130px" StaticEnableDefaultPopOutImage="False" Font-Names="Times,Arial,Verdana" BackColor="Transparent" DynamicMenuStyle-BackColor="Transparent">
<StaticItemTemplate>
<%# Eval("Text") %>
</StaticItemTemplate>
<DynamicMenuStyle CssClass="menuDynamic" />
<LevelMenuItemStyles>
<asp:MenuItemStyle CssClass="menuLevel1" />
<asp:MenuItemStyle CssClass="menuLevel2" />
</LevelMenuItemStyles>
<StaticHoverStyle CssClass="menuStaticHover" />
<DynamicHoverStyle CssClass="menuDynamicHover" />
</asp:Menu>

Simple minds think alike. Great minds come up with something different.
whatispunk
Asp.Net User
Re: Dynamic menu background always white3/7/2007 3:27:16 PM

0/0

A co-worker just pointed me towards a very helpful website, http://www.pastey.net/

So, in an attempt to redeem myself and make this thread a bit more helpful/readable, here are links to my ASP and CSS code on Pastey.net


Simple minds think alike. Great minds come up with something different.
Adam.Kahtava
Asp.Net User
Re: Dynamic menu background always white3/7/2007 5:24:31 PM

0/0

You may be interested in Menu Adapter from the ASP.NET 2.0 CSS Friendly Control Adapters this adapter render a menu that is more CSS friendly which will probably let you manipulate the background settings easier.

-Adam Kahtava [http://adam.kahtava.com]
adbspam
Asp.Net User
Re: Dynamic menu background always white3/7/2007 6:12:01 PM

0/0

I ran into this same problem before and I unfortunately couldn't figure it out either.  Trying to specify a background-color though a stylesheet for the dynamicmenustyle by setting the DynamicMenuStyle CssClass property never seemed to work.  It would work with every other style on the menu, but not the DynamicMenuStyle. 

I just had to workaround it by specifying the actual DynamicMenuStyle BackColor property directly instead of through a class style, which luckily worked for my situation for now, but I understand the frustration and it would be interesting to know why this doesn't work. Almost seems like a bug that someone accidentally left that it always outputs the same style.

etws14
Asp.Net User
Re: Dynamic menu background always white3/8/2007 3:01:48 AM

0/0

whatispunk I have try all the way about the control, honestly tell you this is my second times to use menu control, previously I create the control myself so didn't I didn't discover there has bug there when first time i use. so after few testing to the control with all method of changing the style, i have found that that is a bug. so you may be can try to create the control yourself or you can use the control provided by Adam.Kahtava this may be useful on styling compare to the default control.
whatispunk
Asp.Net User
Re: Dynamic menu background always white3/9/2007 5:48:15 PM

0/0

Thanks man. I'm glad someone else was able to recreate this behavior. I appreciate the effort. Since starting this thread I have redesigned my menu and I no longer care about the background color so all is good.
Simple minds think alike. Great minds come up with something different.
Lonely Rolling
Asp.Net User
Re: Dynamic menu background always white7/3/2007 10:08:23 PM

0/0

The ASP.NET Menu control automatically adds several styles to the embedded header style.  For example:

..ctl00_ucMenu_MenuCBM_0 { background-color:white;visibility:hidden;display:none;position:absolute;left:0px;top:0px; }

The culprit is an internal method of the Menu control called EnsureRenderSettings.  It calls this.Page.Header.StyleSheet.CreateStyleRule() 
several times, adding style rules to the embedded stylesheet.  EnsureRenderSettings is called at the beginning of the Menu's OnPreRender 
method.  Hey, we can override OnPreRender!  That means we're getting closer to an answer, right?  Right, but if we override OnPreRender 
and don't call the base implementation we'll be missing out on some important functionality.  This uses internal methods so we cannot 
emulate it in our override.  

The solution is a bit of a hack, but it's quick and direct.  We override OnPreRender and after calling the base implementation as normal, we 
clear the embedded header styles that were just added.  Add this to to your menu adapter (or derived Menu):

using System.Reflection;
using System.Collections;

protected override void OnPreRender(EventArgs e)
{
    base.OnPreRender(e);

    // Clear the embedded header styles that ASP.NET automatically adds for the menu
    ArrayList selectorStyles = (ArrayList)GetPrivateField(Page.Header.StyleSheet, "_selectorStyles");
    selectorStyles.Clear();
}


/// 
/// Gets the value of a non-public field of an object instance.  Must have Reflection permission.
/// 
/// The object whose field value will be returned.
/// The name of the data field to get.
private object GetPrivateField(object container, string fieldName)
{
    Type type = container.GetType();
    FieldInfo fieldInfo = type.GetField(fieldName, BindingFlags.NonPublic | BindingFlags.Instance);
    return fieldInfo.GetValue(container);
}



It accesses the private member _selectorStyles using a little reflection.


Rebuild your application and you should be good to go.  The embedded style in the header is gone.  Hope this helps!


(P.S. Lutz Roeder's .NET Reflector was instrumental in allowing me to easily track down the problem.)
(P.P.S.  I had to surround my post in 'pre' tags, too, because the Compose tab won't automatically format anything, even line breaks.  I guess 
they just don't care about Opera users.  This will definitely keep me from being an active member of the community.)
14 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Dreamweaver MX 2004: The Missing Manual Authors: David Sawyer McFarland, David Pogue, Pages: 836, Published: 2004
Editing Techniques with Final Cut Pro Authors: Michael Wohl, Pages: 457, Published: 2001
Dreamweaver 8: The Missing Manual Authors: David Sawyer McFarland, David Pogue, Pages: 936, Published: 2006
Photoshop CS3 Bible Authors: Laurie Ulrich Fuller, Robert C. Fuller, Pages: 1164, Published: 2007
Flash 8: Projects for Learning Animation and Interactivity Authors: Rich Shupe, Robert Hoekman, Pages: 340, Published: 2006
User Interfaces to Data Intensive Systems: 5-6 September 1999, Edinburgh, Scotland : Proceedings Authors: Norman W. Paton, Tony Griffiths, Engineering and Physical Sciences Research Council (Great Britain), Teallach Project, Pages: 166, Published: 1999
Macromedia Flash Mx Advanced: Visual Quickpro Guide for Windows and Macintosh Authors: Russell Chun, Pages: 480, Published: 2002

Web:
Dynamic menu background always white - ASP.NET Forums
Dynamic Drive CSS Library- Sliding Doors Vertical Menu Mar 30, 2007 ... Sliding Doors Vertical Menu. Author: Dynamic Drive. This nicely padded vertical menu swaps between two background images depending on ...
Building a Dynamic Menu with CSS and JavaScript, part 1 Jun 22, 2005 ... Before we go deeper into the always-uncertain territory of code, as mentioned previously, I’ve used three background images for the menu. ...
dynamic menu - bytes Nov 19, 2005 ... Guys, I am using a dynamic menu which uses xml,xsl a css file ... handled differently when the mouse is traversing frames (they don't always ...
HV menu script - transparent background - Dynamic Drive Forums HV menu script - transparent background Dynamic Drive scripts help. ... var FontHighColor='white'; // Font color when mouse is over ...
Community Forum Title: Re: Problem displaying Dynamic Tab Menu Backgrounds in IE with 6.0 pro. Post by: Sean White on May 30, 2008, 01:56:29 AM ...
JavaScript Tutorial 10 - Dynamic Form Examples This example also includes verification that the input was a valid hexcode before using it to prepare the new background color. Validation should always be ...
Sage 6.2.10 - Dynamic Menu Still a problem - Page 2 - SageTV Community But as others have said, white text on a light background is never going to look good, .... Is the dynamic menu import updated for 6.2.10? ...
Using CSS and Styles with the Menu Control If you want all static menu items to look the same and all dynamic menu items to look the ... .level1 { color: White; background-color: Black; font-variant: ...
Horizontal Scroller - FlashDen (so that visitors of our site can see the original backgorund of our site) or is the background always white? Posted 2 months ago. Default-profile ...




Search This Site:










problem in using image in a menu

htm map to placeholder

wizard control - phase ii

css not working in firefox

accessing user controls from pages within master pages

inaming & postbackurl

sitemappath and custom providers

how to add child node from the database to the tree view?

how static are master pages?

using ajax to avoid refresh of layout in the master page

master page - content place holder top margin

menu control refresh problem!

gridview not working when trying to use select parameters and a master page

wizard control cancel button

what happened to treeview.autopostback?

how can i add my custom sitemapprovider ?

visual studio .net 2005

selecting parent menu item

master page <td background="images/img.gif" > dosen't work

sitemap.sitemapresolve and treeview

session object not working in master page

how to add a treenode

treeview expand only the selected node on postback

tabstrip image flicker problem

collapsible menu - sql databound

dynamic html body id

asp.net themes discussion

working with menu control

need a way to assign multiple noexpandimageurl property

does anyone know how asp.net 2.0 detect theme files change? thanks

  Privacy | Contact Us
All Times Are GMT