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 8477871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:35:14+00:00 2026-06-10T18:35:14+00:00

My application has a horizontal tab whose code is in the master file. Each

  • 0

My application has a horizontal tab whose code is in the master file. Each aspx page has masterpagefile added to it so horizontal tab appears in each page.

Now I have a scenario where if I click any tab in the horizontal tab that particular tab name has to change color and the rest will remain blue which is the application tab color.

But since the code is in master file, not sure how to approach. I thought of doing changes in the master file but looks like I need to add some hidden variable. Is there a way to add javascript in each aspx to do the same which will simply?

This is my code in master file:

<div id="header">
    <ul id="navigation" title="Navigation" tabindex="200">
    <li><a href="Home.aspx">Home</a></li>
    <li><a href="NIITS.aspx">About NREPP</a>
        <ul>
        <li><a href="Contacts.aspx">Contacts</a></li>
        <li><a href="Search.aspx">Search</a></li>
        </ul>
    </li>
</div>

Page tag in each aspx file for example contacts file is below:

<%@ Page Title="Contacts" Language="C#" MasterPageFile="~/NIITS.master" AutoEventWireup="true" CodeBehind="Contacts.aspx.cs" Inherits="Contacts" %>

What javascript I can write in this aspx file so it changes the tabname(contacts) to black. Any suggestions?

  • 1 1 Answer
  • 0 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-06-10T18:35:16+00:00Added an answer on June 10, 2026 at 6:35 pm

    You don’t need to use javascript to achieve this.

    Run the elements server-side, and in your .aspx file, reference the element by using Master.FindControl(). You can then apply a css class for styling.

    For example, in your Master page you could change the Home navigation link line to:

    <li><a id="navHome" runat="server" href="Home.aspx">Home</a></li>
    

    Then in your Home.aspx file, add something like the following to your code behind:

    protected void Page_Init(){
        ((HtmlControl)Master.FindControl("navHome")).Attributes["class"] += " active"
    }
    

    This will add an additional active class to your anchor element which you can then style:

    #navigation a.active {
       font-weight:bold;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My application has horizontal NSSlider acting as volume control and now with Lion's new
My application has a horizontal top logo that is stretched through all the main
My application has a GUI, it first reads a initialization file and then decides
My application has one activity which starts two services but does not bind them.
My application has multiple SQLite tables(around 20 with different fields). This I have created
My Application has 3 activities (MainActivity,SampleActivity,TempActivity) and Application have to start from MainActivity because
The application has been put in iCloud since the beginning, so I have the
My application has two layouts A and B. In A a user chooses some
My Application has the following structure: myproject (primary Silverlight project) myproject.Web (website for the
Our application has a service layer and a DAO layer, written as Spring beans.

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.