Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hello Friends,

I have created a website in asp.net.

i have designed a menu for it...such as Home, AboutUs, Services , Our mission, Contact us.

So when i click this menu...Suppose if i click services. the back ground color should change on mouse over and the color should stay on that page...so that the user thinks that he is viewing services page.

Please help thanks


This is my Menu Css

CSS
.green #slatenav
{
    position:relative;
 display:block;
 height:42px;
 font-size:12px;
 font-weight:bold;

width:48%;
 background-color:#EFCC00;

font-family:Arial,Verdana,Helvitica,sans-serif;
/*text-transform:uppercase; */
    top:0px;


}

.green #slatenav ul{margin:0px;padding:0;list-style-type:none;width:auto; }
.green #slatenav ul li{display:block;float:left;margin:0 1px 10px 8px;}
.green #slatenav ul li a{display:block;float:left;color:#197E46;text-decoration:none;padding:14px 10px 0 10px;height:28px;

 -moz-border-radius:20px;}

.green #slatenav ul li a:hover,.green #slatenav ul li a.current
{color:#fff;background:transparent url(images/greenslate_backgroundOVER.gif) no-repeat top center;}




XML
<div class="green">
    <div id="slatenav">
    <ul>

            <li><a href="Home.aspx"><span>Home</span></a></li>
            <li><a href="AboutUs.aspx"><span>About Us</span></a></li>
            <li><a href="Services.aspx"><span>Services</span></a></li>
           <li><a href="OurMission.aspx><span>Our Mission</span></a></li>
           <li><a href="ContactUs.aspx"><span>Contact Us</span></a></li>

    </ul>
    </div>
      </div>




Please help thanks.....The bg color should stay on that menu when the user clicks on the menu.
Posted

1 solution

I assume that you want to retain the menu color after click. Have a look at following link from ASP.Net forum. Same issue has been addressed:
http://forums.asp.net/t/1595158.aspx/1[^]
Another:
http://stackoverflow.com/questions/6216929/asp-net-selected-menu-item-does-not-retain-selected-backcolor[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900