Passing Parameters in Windows Phone 7

Monotoko

Senior Member
Dec 29, 2012
91
21
0
Hey All,

Quite a simple question but I can't seem to find a decent answer for it. Let's say I have a button on one xaml page and want to pass some parameters through to the next page. So I build a button that goes to another view with a parameter, say the Uri is "/Views/TwitterPage.xaml?id=1"

Now my question is, how do I pull that id variable from the parameters on the next page and put it into a text box?

Monotoko
 

titi66200

Senior Member
Jun 2, 2009
1,493
430
113
PERPIGNAN
You have try this
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (base.NavigationContext.QueryString.ContainsKey("id"))
{
var id = base.NavigationContext.QueryString["id"];
// Use the id
}
}
 
  • Like
Reactions: Monotoko

Monotoko

Senior Member
Dec 29, 2012
91
21
0
You have try this
protected override void OnNavigatedTo(NavigationEventArgs e)
{
if (base.NavigationContext.QueryString.ContainsKey("id"))
{
var id = base.NavigationContext.QueryString["id"];
// Use the id
}
}
Thanks, but how do I then put it into a box in the xaml file? I've tried using binding but it isn't working.