Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:21:16+00:00 2026-06-18T06:21:16+00:00

Possible Duplicate: How to pass the image value in one xaml page to another

  • 0

Possible Duplicate:
How to pass the image value in one xaml page to another xaml page in windows phone 7?
Passing data from page to page

I think is not a duplicate, because I dont found answer for my question, I dont passing an image, I passing 2darray[3,3] values in Page2.
I am developing a Windows Phone 7 app. I have two pages (mainpage and page2). I wrote the code in the mainpage. I have a 2D array with values. How can I use this array in page2? Please give a step by step answer, I am a beginner.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:21:18+00:00Added an answer on June 18, 2026 at 6:21 am

    You can use JSON to serialize your array. You can use JSON.net like I did. Remember that you cannot pass every string to your Uri – if it contains characters like ‘&’ your app will crash. That’s why you have to use Uri.UnescapeDataString.

    This an example for 2D string array. If you need to pass complex objects it’s still possible to use JSON.net (see the documentation). Just remember to use Uri.UnescapeDataString after serialization.

    Before you deserialize your array from JSON you have to unescape it (Uri.UnescapeDataString).

    In your source page:

    using System;
    using System.Net;
    using System.Windows;
    using Microsoft.Phone.Controls;
    using Newtonsoft.Json;
    
    namespace PhoneApp2
    {
        public static class Extensions
        {
    
            public static string GetHtmlDecoded(this string str)
            {
                return HttpUtility.HtmlDecode(str);
            }
    
            public static string GetHtmlEncoded(this string str)
            {
                return HttpUtility.HtmlEncode(str);
            }
    
        }
    
        public partial class MainPage : PhoneApplicationPage
        {
            // Constructor
            public MainPage()
            {
                InitializeComponent();
            }
    
    
            private void button1_Click(object sender, RoutedEventArgs e)
            {
    
    
                var arrStr = new[,]
                    {
                        {"aaaa$ffeaw&fewa=324&fewa", "fewa"},
                        {"aafw&fewa=324&fewa", "fefewa"},
                    };
    
    
                string param = JsonConvert.SerializeObject(arrStr);
                param = Uri.EscapeDataString( param);
    
                var destination = new Uri("/Page1.xaml?arr=" + param, UriKind.Relative);
                NavigationService.Navigate(destination );
            }
        }
    }
    

    In the destination page:

    using System;
    using Microsoft.Phone.Controls;
    using Newtonsoft.Json;
    
    namespace PhoneApp2
    {
        public partial class Page1 : PhoneApplicationPage
        {
            public Page1()
            {
                InitializeComponent();
            }
    
            protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
            {
                base.OnNavigatedTo(e);
                var param = Uri.UnescapeDataString(NavigationContext.QueryString["arr"]);
                var arr = JsonConvert.DeserializeObject<string[,]>(param);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to pass image data from one activity to another activity? pass
Possible Duplicate: How to pass a value from one Activity to another in Android?
Possible Duplicate: Passing data between asp.net pages how to pass value of TEXTBOX from
Possible Duplicate: pass data from Action To Another Action I have a view in
Possible Duplicate: How to Pass String to another forms from one form in c#
Possible Duplicate: How to pass object from one activity to another in Android I
Possible Duplicate: How to pass object from one activity to another in Android I
Possible Duplicate: How to pass object from one activity to another in Android While
Possible Duplicate: How to pass object from one activity to another in Android I
Possible Duplicate: How to pass a variable / data from javascript to php and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.