Stepyogameup
Programmer
- Nov 4, 2008
- 3
I have a masterpage and in a master page I have a menu.
I want when a user clicks on a menu to set id="current" on li html attribute.
I not sending the user to another page because the menu is in the MasterPage.
How can I solve this problem using c# code?
Menu
CSS
I want when a user clicks on a menu to set id="current" on li html attribute.
I not sending the user to another page because the menu is in the MasterPage.
How can I solve this problem using c# code?
Menu
Code:
<!-- header menu-->
<div id="header">
<span id="slogan"><asp:Label runat="server" ID="lblSlogan" Text="DevWebshop" /></span>
<!-- tabs -->
<ul>
<li [COLOR=red]id="current"[/color]><a href="CustomerInformation.aspx"><span>Home</span></a></li>
<li><a href="Default.aspx?IsPage=Administration"><span>Show shopping cart</span></a></li>
<li><a href="Sales.aspx?IsPage=Sales"><span>Customer account</span></a></li>
<li><a href="#"><span>Contact us</span></a></li>
</ul>
</div>
CSS
Code:
/* header */
#header {
position: relative;
margin: 0; padding: 0;
height: 60px;
}
#header span#slogan {
z-index: 3;
position: absolute;
left: 3px; bottom: 7px;
font: bold 1.2em Verdana, Arial, Tahoma, Sans-serif;
color: #FFF;
}
#header-logo {
position: relative;
clear: both;
height: 50px;
margin: 0; padding: 0;
}
#header-logo #logo {
position: absolute;
top: 3px; left: 5px;
font: bold 30px "trebuchet MS", Arial, Tahoma, Sans-Serif;
margin: 0; padding: 0;
letter-spacing: -1px;
color: #000;
}
/* navigation tabs */
#header ul {
position: absolute;
margin:0;
list-style:none;
right:-18px ; bottom: 3px;
font: bold 13px 'Trebuchet MS', Arial, Sans-serif;
}
#header li {
display:inline;
margin:0; padding:0;
}
#header a {
float:left;
background: url(../Images/tableft.gif) no-repeat left top;
margin:0;
padding:0 0 0 4px;
text-decoration:none;
}
#header a span {
float:left;
display:block;
background: url(../Images/tabright.gif) no-repeat right top;
padding:5px 15px 4px 6px;
color:#FFF;
}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
#header a span {float:none;}
/* End IE5-Mac hack */
#header a:hover span {
color:#FFF;
}
#header a:hover {
background-position:0% -42px;
}
#header a:hover span {
background-position:100% -42px;
}
#header #current a {
background-position:0% -42px;
}
#header #current a span {
background-position:100% -42px;
}