Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing data from page to page

I'm looking for the best practice on how to pass data from page to page.

In Page A I have a button that fires off Page B.
On Page B I have 6 textboxes that allow the user to enter information. When the user is done, the click on a button that brings them back to Page A.

I want to pass that data back to Page A.

I've seen suggestions to:

  • build XML documents and save to Isolated Storage
  • use the App class to store information in properties
  • pass it like a query string

I'm looking for the Best practice. Is there one that Microsoft recommends or one that is generally accepted as the best way?

Thanks

like image 993
webdad3 Avatar asked Feb 10 '11 04:02

webdad3


People also ask

How do you pass information between pages?

There are two ways to pass variables between web pages. The first method is to use sessionStorage, or localStorage. The second method is to use a query string with the URL.

How do I move data from one page to another page in Nextjs?

1 Answer. Show activity on this post. and then receive that data in your other page using router : import { useRouter } from 'next/router' const router = useRouter(); const data = router.


2 Answers

PhoneApplicationService.Current.State["yourparam"] = param NavigationService.Navigate(new Uri("/view/Page.xaml", UriKind.Relative)); 

then in other page simply

var k = PhoneApplicationService.Current.State["yourparam"]; 
like image 125
LXG Avatar answered Sep 21 '22 12:09

LXG


Personally I'd store the values entered on Page B in a model(object) that is also accessible to Page A.

Depending on how you're navigating to Page A the second time, one or more of the following may be usful to help understand passing values between pages:

How to pass the image value in one xaml page to another xaml page in windows phone 7?

Passing a complex object to a page while navigating in a WP7 Silverlight application

How to pass an object from a xaml page to another?

How to pass a value between Silverlight pages for WP7?

How do I navigate from one xaml page to another, and pass values?

like image 27
Matt Lacey Avatar answered Sep 23 '22 12:09

Matt Lacey