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

  • SEARCH
  • Home
  • 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 7622787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:32:27+00:00 2026-05-31T04:32:27+00:00

hi i need to use a variables from page to show in another page

  • 0

hi i need to use a variables from page to show in another page at text block in windows phone 7. i got a problem that the second page doesn’t declare the variables: here’s a part of my code:

public static class MainPage : PhoneApplicationPage
{
    string result;//var i wanna use at the all application pages
    string status;//var i wanna use at the all application pages
    string userId;//var i wanna use at the all application pages
    string msg;//var i wanna use at the all application pages

    WebClient client;

    // Constructor
    public MainPage()
    {
        InitializeComponent();

        client = new WebClient();
        client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
    }
}

///second page
public partial class info : PhoneApplicationPage
{
    public info()
    {
        InitializeComponent();
        textBlock1.Text = result.value();
    }
}

but this code dosent work ny help??

  • 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-05-31T04:32:28+00:00Added an answer on May 31, 2026 at 4:32 am

    but this code dosent work

    Because your variables are private and their scope is limited to the MainPage class.

    If you want them to be public, you have to add the public keyword.

    Better: you should use properties instead:

    public string Result { get; set; }
    

    Also, you can’t write a global variable. As C# is an object-oriented programming language, you’ll have to use an instance of your MainPage class to access to your properties:

    MainPage myPage = new MainPage();
    ....
    textBlock1.Text = myPage.Result;
    

    Another thing: you’re using variables/properties, not functions. So you can’t write result.value();. Use result.value; instead.

    I suggest you to have a look at this MSDN article about properties.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several variables that I need to send from page to page... What
I need to use hidden variables in my JSP for session tracking. This is
I need to use the javascript loop variable i in the loop block. for
I need a static variable that points to itself to use when referencing the
I'm planning to use some session variables on an intranet ASP/VB.NET page, and want
I need to display a page in drupal that is created by a template
Hey, I've got what has become an extremely frustrating problem with $_Post variables. I'll
I have two pieces of code that I need to use together. I am
I am trying to use javascript to print out a text field from a
I'm writing code in Visual C++ and I need to use a global variable.

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.