Pass complex object between pages in C#

后端 未结 2 1488
广开言路
广开言路 2021-01-26 09:24

I am using this code to pass values in my Windows 8 app.

The following code passes data to a page when an item is clicked, So it passes sectorId to the Quiz page.

<
2条回答
  •  野性不改
    2021-01-26 10:03

    Passing data between pages is usually done using the query-string (GET) or by using a form (POST). You cannot really pass a complex object between pages, unless you serialize it to a string first and then use the before mentioned methods (GET/POST), but that's not recommended due to length restrictions.

    However, you can use the session state and/or the application state to store complex objects (as long as they are serializable) and use them across different requests.

提交回复
热议问题