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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:48:50+00:00 2026-05-23T21:48:50+00:00

I have a simple unordered list with links in it. <body> <div id=topMenu> <ul>

  • 0

I have a simple unordered list with links in it.

<body>
    <div id="topMenu">
        <ul>
            <li><a class="selected" href="../Default.aspx">Start</a></li>
            <li><a href="../Category/ShowAll.aspx">Categories</a></li>
            <li><a href="../Elements/ShowAll.aspx">Elements</a></li>
            <li><a href="../Articles/ShowAll.aspx">Articles</a></li>
        </ul>
    </div>
    <asp:ContentPlaceHolder ID="MainContentPlaceholder" runat="server">
    </asp:ContentPlaceHolder>
</body>

I want to change the class of the link i click to the “selected” class, which is the easiest way to do this. I thought about making it into linkbuttons and saving the info in the session, but that seems overkill, there has to be an easier approach?

  • 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-05-23T21:48:51+00:00Added an answer on May 23, 2026 at 9:48 pm

    Well, you can just put the <a> to be runat="server" and then access them from codebehind:

    hyperLink.Attributes["class"] = "opened";
    

    You can have this in your master page with the menu, and you can have your child pages send the id of the hyperlink they need selected, something like

    In your master (the linkWrapper can be your <ul> as runat server):

    (HyperLink)linkWrapper.FindControl(childPageMenuAnchorLinkId);
    

    In your child:

    masterPage.ChildPageMenuAnchorLinkId = "link_Customers";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple unordered list with list items as menu item i created
I have a simple ASP.Net form with the following unordered list: <ul id=ctl00_ContentPlaceHolder1_BulletedList1> <li>No
I have a simple unordered list that I want to show and hide on
I have got an simple html unordered list. <ul> <li>Item 1</li> <li> Group 1
I have an unordered list like so: <ul class=foo> <li id=asdf> <span class=indexnumber></span> <span
I have simple unordered list menu. Code is below or you can grab it
I have 3 btns which are simple anchor tags within an unordered list each
I have a simple unordered list with 16 list items. I want to add
I have an unordered list of links that I need to append the index
so i have a simple unordered list: <ul id=nav> <li> <span>Group 1 »</span> <ul>

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.