SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems the Client Object Model is stripping out the "query" part of a URL stored inside the NavigationNode elements. I am wondering if this is a bug or perhaps I am doing something wrong?

Consider the following example. Site navigation is configured with a single item under the global navigation called Affordability and a URL that contains ?FilterField1=ContentType&FilterValue1=Affordability at the end of URL for the All Items view:

var root = "https://server/sites/site/";
var ctx = new ClientContext(root);
var web = ctx.Web;
var nav = web.Navigation;
var bar = nav.TopNavigationBar;

// use the TopNavigationBar collection
Console.Write(bar[0].Title + "=" + bar[0].Url);
// outputs "Affordability=/sites/sites/Lists/List/AllItems.aspx"

It seems to strip off the actual filtering part of the URL. It is still present in the Navigation settings, and clicking the link in the Web UI works just fine. I understand I could create views for all the different filtering criteria - that isn't really what I am looking for though. I am curious to see if this is a bug in the Client Object Model (maybe I somehow have an old version?) or perhaps I doing something wrong?

share|improve this question
up vote 1 down vote accepted

Thanks to Oleg's post:

It seems that in a site with the Publishing feature enabled, the query string is stored in a separate property: UrlQueryString.

So to access the full Url+QueryString you would need: bar[0].Url+bar[0].Properties["UrlQueryString"]

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.