I am making an application in visual studio for windows phone C#
I have two text boxes on main page.
I want to send their content to second page.
but i am not able to do it
I am able to send only one text box (name1) but not other (name2)using
NavigationService.Navigate(new Uri("/Page1.xaml?msg=" + name1.Text, UriKind.Relative));
please help
Depending on if the values in your textboxes are to create some form of internal state or not, I would create a static class that holds the current state.
When text is entered into the box, update 2 strings on this static class. The class will obviously still be available to pull data from in your future pages, and also if the user happens to hit ‘Back’ in the application. It will probably help you when you extend it in the future to hold more data also.
However, there should be no issue in passing across multiple values using the
Urimethod that you’re using at the moment, you could simply do this:Note that
Urinavigation isn’t the best way to pass your parameters, though.