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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:29:55+00:00 2026-05-23T10:29:55+00:00

I currently have an asp Menu Control which loads a SiteMapDataSource in my Master

  • 0

I currently have an asp Menu Control which loads a SiteMapDataSource in my Master Page. One of the site map nodes is "Tools" which opens a general "Tools.aspx" content page.

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/Default.aspx" title="Home"  description="">
    <siteMapNode url="Tools.aspx" title="Tools"  description="" />
  </siteMapNode>
</siteMap>

The "Tools.aspx" page contains an image button that takes the user to another content page "Translator.aspx". When navigating to this page the "Tools" menu item is no longer selected. My question is, how can I select the "Tools" menu item from the master page, within the "Translator.aspx" page?

I have tried the following method within the "Translator.aspx" page load:

protected void Page_Load(object sender, EventArgs e)
{
    //check if logged in
    if (!Page.IsPostBack)
    {
        Menu mp_Menu = (Menu)Page.Master.FindControl("mnuMaster");

        foreach (MenuItem mi in mp_Menu.Items)
        {
            if (mi.Text == "Tools")
            {
                mi.Selected = true;
            }
        }

    }
}

This does not work and it appears that 0 menu items are returned.

Would really appreciate it if someone could shed some light on this issue.

  • 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-23T10:29:56+00:00Added an answer on May 23, 2026 at 10:29 am

    I solved this by entering the following code in the Master Page:

    protected void mnuMaster_MenuItemDataBound(object sender, MenuEventArgs e)
        {
            if (Session["Translator"] != null)
            {
                if (mnuMaster.Items.Count > 0)
                {
                    foreach (MenuItem mi in mnuMaster.Items)
                    {
                        if (mi.Text == "Tools")
                        {
                            mi.Selected = true;
                            Session["Translator"] = null;
                        }
                    }
                }
            }
        }
    

    I then added the following to the “Translator.aspx” page:

    protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Session["Translator"] = "true";
            }
        }
    

    I don’t think this is the ideal solution but it worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I have an ASP.NET / C# application in which the Master Page contain the
Some background. Currently have an asp.net web site which is contained on 2 web
I currently have an ASP.net 2.0 site with multiple ASP.Net 1.1 sites running as
I currently have a gridview that has an asp:ButtonField as one of the columns.
I currently have an Instance of the ASP.net ajax control toolkit combo box residing
I have a master page with a bunch of menu like: <ul id=ulMenu runat=server>
The Scenario I have an ASP.Net Web Project that uses a master page. This
I have a menu running off of a sitemap which one of the SiteMapNode
We currently have a classic asp 404 error page. By default, it's returning a

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.