SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

I want to add some links to Quicklaunch bar. The link needs to have query string parameters, eg.: /sites/project/default.aspx?mode=filter

string url = "/sites/project/default.aspx?mode=filter";
string title = "Filter";

SPNavigationNodeCollection quickLaunch = web.Navigation.QuickLaunch;
SPNavigationNode newnode = new SPNavigationNode(title, url, false);

Unfortunatelly, this code adds quicklaunch link without the parameter, ie.: /sites/project/default.aspx.

What is correct way to add link with params from code?

share|improve this question
up vote 3 down vote accepted

In the SPNavigationNode make the isExternal variable as true . Check this article Link

share|improve this answer
Or change constructor to: new SPNavigationNode(title, url, true); Thanks! – Tschareck Mar 20 '13 at 8:32

I know this is quite old post, but setting IsExternal to true works.. but isn't the correct way of adding Query String..

Here is how you add a Query String:

string url = "/sites/project/default.aspx";
string title = "Filter";

SPNavigationNodeCollection quickLaunch = web.Navigation.QuickLaunch;
var newNode = new SPNavigationNode(title, url, false);
newNode.Properties["UrlQueryString"] = "mode=filter";


programmatically passing navigation node url with querystring

share|improve this answer
Nice solution, however this works only when publishing is enabled. See :… – Nils Mar 7 at 13:54

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.