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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:06:49+00:00 2026-05-21T22:06:49+00:00

<GlobalNavigation> <primarylink> <secondarylink> <linkid>1</linkid> <linkName>3</linkname> <secondary> <leftnav> <linkid>left1</linkid> <linkName>linktext</linkname> </leftnav> </secondary> </secondarylink> </GlobalNavigation> i

  • 0
<GlobalNavigation>
<primarylink>
<secondarylink>
    <linkid>1</linkid>
    <linkName>3</linkname>
    <secondary>
        <leftnav>
            <linkid>left1</linkid>
            <linkName>linktext</linkname>
        </leftnav>
    </secondary>
</secondarylink>
</GlobalNavigation>

i want to read leftnav linkname by giving linkid.

  • 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-21T22:06:50+00:00Added an answer on May 21, 2026 at 10:06 pm

    The simplest way is to use LINQ to XML:

    var doc = XDocument.Load(...);
    
    string linkId = "left1";
    var linkName = doc.Descendants("leftnav")
                      .Elements("linkid")
                      .Where(x => x.Value == linkId)
                      .Single()
                      .Parent.Element("linkName").Value;
    

    In other words:

    • Look in each leftnav element
    • Look in each linkid element directly under it
    • Find a linkid element with the desired value
    • There should be exactly one of these (there are other options you may wish to use here, which would change the rest of the solution). Select this one linkid element.
    • Take the parent element
    • Find the first linkName element under it
    • Extract the value (i.e. the text within it)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?xml version=1.0 encoding=utf-8 ?> <PrimaryLink> <LinkID>p1</LinkID> <SecondaryLink> <LinkID>s1</LinkID> <LeftMenu> <NavLinks> <LinkID>n1</LinkID> </NavLinks> <NavLinks> <LinkID>n2
I have sharepoint site and i want read in code global navigation information. On
Is it possible to read the Global Navigation of all the sub sites and
I'm creating a new site and I want to make it as easy as
I have a subsite that I have changed the global navigation setting to Display
I've been working on styling an intranet for the company I'm working for, and
We have a custom master page that is deployed to My Site, as well
I recently came across an encoding issue specific to how Firefox encodes URLs directly
I created a web page with a custom page layout, the site the page
I am working on a single sign-on login page using Shibboleth that will be

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.