How can I pass query string variables with NavigationService.Navigate?

Posted by Mike Hildner on Stack Overflow See other posts from Stack Overflow or by Mike Hildner
Published on 2010-12-29T16:49:41Z Indexed on 2010/12/29 16:54 UTC
Read the original article Hit count: 255

Greetings,

Searched for this, but no luck.

I'm attempting to pass query string variables (and then retrieve them) in my Silverlight 4 app. First I tried this

    this.NavigationService.Navigate(new Uri("/LoanProductionRegion?Elvis=Alive&ImHungry=true", UriKind.Relative));

But HtmlPage.Document.QueryString doesn't pick them up because they come after the anchor (the full url looks like http://localhost:1076/Dashboard.SLTestPage.aspx#/LoanProductionRegion?Elvis=Alive&ImHungry=true).

I tried to put the vars in front, such as

    this.NavigationService.Navigate(new Uri("?Elvis=Alive&ImHungry=true/LoanProductionRegion", UriKind.Relative));
    this.NavigationService.Navigate(new Uri("/?Elvis=Alive&ImHungry=true/LoanProductionRegion", UriKind.Relative));

But both result in a "Page not found" error. Anyone know how to achieve what I'm after?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about silverlight-4.0