Working with <asp:menu...

  • Thread starter Thread starter Smith
  • Start date Start date
S

Smith

Hello,
Does someone know a link to an example of customization of an asp:menu?

Many thansk in advance.
S
 
Here is a more specific question. I searched google and did not fidn a way
to do this.
I have the folowing in the stylesheat of the theme i use for my application:
a:LINK { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:
12px; color: #003399}

a:ACTIVE {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0033FF;

}

a:HOVER {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0033FF;

}

a:VISITED {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #666666;

}



But i do not want this to applly to my <asp:menu control in the master
page.

I tried to set the different properties in the menu definition e.g.

DynamicHoverStyle-ForeColor="white"

but the above has not effect. Can someone tell me how to achive this?

Thanks

S
 
But i do not want this to applly to my <asp:menu control in the master
page.

I tried to set the different properties in the menu definition e.g.

DynamicHoverStyle-ForeColor="white"

but the above has not effect. Can someone tell me how to achive this?

I do that by using separate styles...

1) Create a separate style just for the menu:

..MenuHoverStyle
{
color:white;
}

2) Reference it

<asp:Menu ID="mnuMenu" runat="server"
StaticHoverStyle-CssClass="MenuHoverStyle"
DynamicHoverStyle-CssClass="MenuHoverStyle">
 
1) Create a separate style just for the menu:
.MenuHoverStyle
{
color:white;
}

2) Reference it

<asp:Menu ID="mnuMenu" runat="server"
StaticHoverStyle-CssClass="MenuHoverStyle"
DynamicHoverStyle-CssClass="MenuHoverStyle">

Great,
That sounds brillant.

I will give it a try
Thanks
S
 
I use the following
..MenuHoverStyle

{

color:white;

background-color:Black;


}

I was expeting the menu text to be black. It doesnt. What is wrong with my
style?





StaticHoverStyle-CssClass="MenuHoverStyle"
 
I use the following
.MenuHoverStyle

{

color:white;

background-color:Black;


}

I was expeting the menu text to be white. It doesnt. What is wrong with my
style?

Hmm - nothing as far as I can see... What colour is it, AAMOI...?
StaticHoverStyle-CssClass="MenuHoverStyle"

Do you not have any dropdown menus...? If you do, you need to set the
DynamicHoverStyle-CssClass property too...
 
Do you not have any dropdown menus...? If you do, you need to set the
DynamicHoverStyle-CssClass property too...

The menu color folow the a:Link definiton of tyhe stylesheet ...
a:LINK { font-family: Verdana, Arial, Helvetica, sans-serif; font-size:
12px; color: #003399}

a:ACTIVE {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0033FF;

}

a:HOVER {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #0033FF;

}

a:VISITED {

font-family: Verdana, Arial, Helvetica, sans-serif;

font-size: 12px;

color: #666666;

}



It does work when i remove these styel from myn .css file.



What can i do to have both?
 
It does work when i remove these styel from myn .css file.

That's interesting...
What can i do to have both?

I'm afraid I don't know...

If it helps, this works for me:


body
{
background-color:white;
font-family:Verdana, Arial, Sans-Serif;
font-size:9px;
font-weight:normal;
text-decoration:none;
overflow:auto;
margin-left:0px;
margin-right:0px;
margin-top:0px;
margin-bottom:0px;
}
..button
{
background-color:#0099FF;
border-color:white;
border-style:ridge;
border-width:1px;
color:white;
}
td
{
font-family:Verdana, Arial, Sans-Serif;
font-size:11px;
font-weight:normal;
text-decoration:none;
}
submit
{
background-color:#0099FF;
border-color:White;
border-style:ridge;
border-width:1px;
color:White;
}
input
{
font-family:Verdana, Arial, Sans-Serif;
font-size:11px;
font-weight:normal;
text-decoration:none;
}
select
{
font-family:Verdana, Arial, Sans-Serif;
font-size:11px;
font-weight:normal;
text-decoration:none;
}
textarea
{
font-family:Verdana, Arial, Sans-Serif;
font-size:11px;
font-weight:normal;
text-decoration:none;
}
ul
{
margin-top:0px;
margin-bottom:0px;
}
div
{
font-family:verdana;
}
a
{
color:black;
}
a:visited
{
color:black;
}
a:hover
{
color:red;
}
..staticMenuItemStyle
{
width:60px;
height:20px;
background-color:#dcdcdc;
color:black;
display:block;
}
..dynamicMenuItemStyle
{
width:120px;
height:20px;
background-color:#dcdcdc;
color:black;
display:block;
}
..MenuHoverStyle
{
background-color:#b0c4de;
}



<asp:Menu ID="mnuMenu" runat="server" Orientation="Horizontal"
StaticMenuItemStyle-CssClass="staticMenuItemStyle"
StaticHoverStyle-CssClass="MenuHoverStyle" StaticPopOutImageUrl=""
StaticEnableDefaultPopOutImage="false"
DynamicMenuItemStyle-CssClass="dynamicMenuItemStyle"
DynamicHoverStyle-CssClass="MenuHoverStyle" DynamicPopOutImageUrl=""
DynamicEnableDefaultPopOutImage="false">
<Items>
...
</Items>
</asp:Menu>
 
Hi Mark,
That does indeed make some difference.
I will continue my work on that basis.

many thanks for your help.
S
 
That does indeed make some difference.
I will continue my work on that basis.

Now I'm curious!

I'm glad that my markup worked for you, but I'd be really interested to know
why... :-)
 
Now I'm curious!
I'm glad that my markup worked for you, but I'd be really interested to
know why... :-)

Well,
I just removed my html tag styles and build on top of your markup adding
what i needed the appropriate places ;)
Does tha make sense?
 
I just removed my html tag styles and build on top of your markup adding
what i needed the appropriate places ;)
Does tha make sense?

Not really... :-)

I'm not sure what you were doing differently to stop it working...???
 
Back
Top