Home > DeveloperSection > Forums > Dropdown Menu in ASP.NET
John Smith

Total Post:101

Points:711
Posted on    September-30-2010 10:08 AM

 ASP.Net ASP.Net 
Ratings:


 2 Reply(s)
 6074  View(s)
Rate this:
I am working on dropdown menu in ASP.NET.
On mouse over I like to change back color of that particular Menu.
I really appreciate if you provide me line of code.



Amit Singh

Total Post:103

Points:721
Posted on    September-30-2010 12:58 PM

we add the css on onmouseover="function colorChange(this)"
<script>
function colorChange(obj)
{
obj.style.backgroundColor="red";
}
</script>

Modified On Oct-01-2010 03:01:58 AM

Alex R
Alex R

Total Post:40

Points:280
Posted on    October-01-2010 2:40 AM

Hello John,

You can change back color of dropdown menu by setting it hover property back color.

<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal">

<DynamicHoverStyle BackColor="Yellow" />

<Items>

<asp:MenuItem Text="Item1" Value="Item1">

<asp:MenuItem Text="New Item1" Value="New Item1"></asp:MenuItem>

<asp:MenuItem Text="New Item2" Value="New Item2"></asp:MenuItem>

<asp:MenuItem Text="New Item3" Value="New Item3"></asp:MenuItem>

</asp:MenuItem>

<asp:MenuItem Text="Item2" Value="Item2">

<asp:MenuItem Text="New Item1" Value="New Item1"></asp:MenuItem>

<asp:MenuItem Text="New Item2" Value="New Item2"></asp:MenuItem>

</asp:MenuItem>

</Items>

</asp:Menu>

Modified On Oct-01-2010 02:50:46 AM

Don't want to miss updates? Please click the below button!

Follow MindStick