Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:52:27+00:00 2026-05-15T05:52:27+00:00

I have an ASP.NET MVC site (Master Page + Content pages). On the master

  • 0

I have an ASP.NET MVC site (Master Page + Content pages).
On the master page, I have a menu. When some of the options are selected on the menu, it brings you to the appropriate controller and shows the page, which is fine, but it also shows a submenu. The submenu shows just fine, but the issue lies in the menu. I cant get the menu’s css to work for me.

Here’s the menu code:

<ul id="menuDeveloper">
    <li><%= Html.ActionLink("Home", "Index", "Home", new { area = (String)null }, null)%></li>
    <li id='idcardselect'><%= Html.ActionLink("IDCard", "Index", "IDCardSelect", new { area = "IDCard_Select" }, null)%></li>
    <li><%= Html.ActionLink("Groups", "Index", "GroupSetup", new { area = "Group_Setup" }, null)%></li>
</ul>

Here is the CSS that goes with it:

    ul#menuDeveloper{
  font-family: Arial, Helvetica, sans-serif;
  font-size: 93%;
  float: right;
  background: url("images/bg-menu.gif") no-repeat 50% -9px;
  margin-right: 22px;
  margin-top:  6px;
  height: 46px;
  width: 541px;
 }
  ul#menuDeveloper li{
   float: left;
   margin-left: 20px;
   margin-top: 10px;
  }
   ul#menuDeveloper li a{
    color: #6192c1;
    padding: 10px 2px 15px 2px;
    text-decoration: none;
    text-transform: uppercase;
    height: 46px;    
   }
    ul#menuDeveloper li a.active{
     background: #e0e0e0;
     color: #1f67a7;
    }
    ul#menuDeveloper li a:hover{
     background: #e0e0e0;
     color: #1f67a7;
    }

    ul#menuDeveloper li.menuidcardactive
    {
     background: #e0e0e0;
     color: #1f67a7;
    }

All of the CSS works just fine, EXCEPT the last part (the .menuidcardactive class).
It may be the way I am applying it. Basically, what happens is that the

  • element does NOT get the style, but the element gets a portion of it (just the background portion, the ‘color’ does not change). I’ve tried several methods of changing the class. I just want the
  • to be “active” while the submenu is shown, so the menu’s “connect” and the user understands what the submenu is for.

    Here is a sample of what I have tried to change the class for the

  • :

    $("#idcardselect").attr('class', 'menuidcardactive');
    $("#idcardselect").addClass('menuidcardactive');
    $("#idcardselect").removeClass().addClass('menuidcardactive');
    

    All of these were done inside the $(window).load(function(){}); code block of the index page (of the menu item clicked on, in this case “IDCard”).

    Any thoughts/solutions would be greatly appreciated.

    Thanks!

    • 1 1 Answer
    • 2 Views
    • 0 Followers
    • 0
    Share
    • Facebook
    • Report

    Leave an answer
    Cancel reply

    You must login to add an answer.

    Forgot Password?

    Need An Account, Sign Up Here

    1 Answer

    • Voted
    • Oldest
    • Recent
    • Random
    1. Editorial Team
      Editorial Team
      2026-05-15T05:52:28+00:00Added an answer on May 15, 2026 at 5:52 am

      I think the problem lies in your css. Try adding ‘a’ to the end of the last item so that you are applying that style to the anchor and not the li.

      ul#menuDeveloper li.menuidcardactive a
      

      instead of

      ul#menuDeveloper li.menuidcardactive
      

      What seems to be happening is that your style is being applied to the li (so your background gets applied) but the text color is getting overridden by

      ul#menuDeveloper li a
      
      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
        • Report

    Sidebar

    Related Questions

    I have a asp.net mvc site with a master page and it has following
    Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
    I have a ASP.NET MVC site using Membership Provider. I have trouble testing some
    I have this code in my ASP.NET MVC project master page: <% switch(Request.Browser.Browser) {
    I created a default ASP.net MVC project. In the Master page I have the
    I have an asp.net-mvc site. I have a page with a grid of data
    I've started to work a bit with master pages for an ASP.net mvc site
    I have the following code in my Site.Master page of an almost empty ASP.NET
    I have an ASP.NET MVC site and ELMAH is showing me that my site
    I have a asp.net mvc site that references a couple of libraries. Recently I

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • New Questions
      • Trending Questions
      • Must read Questions
      • Hot Questions
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • SEARCH

    Footer

    © 2021 The Archive Base. All Rights Reserved
    With Love by The Archive Base

    Insert/edit link

    Enter the destination URL

    Or link to existing content

      No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.