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 6029831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:56:44+00:00 2026-05-23T04:56:44+00:00

i am developing a web for my final project,and im new to ASP.NET and

  • 0

i am developing a web for my final project,and im new to ASP.NET and this forum.
thx to all who help me.

the question is…
example i have 2 pages.

page1.aspx.cs (this page for receive variable from mikrokontroler via network module)
example mikrokontroler send a variable “status” = 1

    protected void Page_Load(object sender, EventArgs e)
    {
        NameValueCollection POST = Request.Form;
        int STATUS;
        int responcode;

        try
        {
            A = int.Parse(POST["status"]);
        }
        catch (Exception)
        {
            status = 0;            
        }

        if (A == 1)
        {
            responcode = 200;   

            //when A = 1, i want to store A value to (buffer on something <-- this what i want to ask)).
            so i can call the value anytime in page2.               
        }
        else                
        {
            responcode = 400;              
        }

        Response.StatusCode = responcode;
    }
}

}

page2.aspx
(in page 2 there is button and textbox)

protected void Button3_Click(object sender, EventArgs e)
    {
      /*when this button click,
     i want to show A value from page1
      */
    }
  • 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-23T04:56:45+00:00Added an answer on May 23, 2026 at 4:56 am

    You have a lot of options to store the variable value:

    1. session state: Session[“status”]= A
    2. application state: Application[“status”] = A
    3. asp net cache: using Cache.Add()
    4. database: here i would store also the timestamps, to trace the historic status of the controller.
    5. local XML file.

    It all depends on the scope of the stored data: session data is local to the current user/session and will expire after a predefined timeout(def: 20mins), application will be global to all your users/sessions and will expire when you will restart the application (by iis, iisreset, recompiling…), cache is global and will expire based on the parameters of invocation, the database and xml are global and will maintain state.

    In your case i would use database or application store, because the microcontroller and user live in different sessions and the app cache is not a suitable messaging mechanism while Xml introduces some problems on his own (eg: filesystem permissions, data replication…).

    write:

    Application["status"] = A;
    

    read:

    int A = 0;
    bool result = int.TryParse(Application["status"],out A);
    

    BTW: to parse the integer you can skip the try/catch part doing this:

    int A = 0;
    bool result = int.TryParse(POST["status"],out A);
    

    in this case if unable to parse A will be equal to 0;

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

Sidebar

Related Questions

I'm writing this question from the standpoint of an ASP.NET application. However I realize
Over the past 6 months I've been developing web sites using asp.net. When I
I an developing a web application in ASP.Net using C#, under .Net Framework 4.0.
I've been developing web apps for over a decade now, all the way from
we're developing a web app to cover all aspects of a printing company from
I'm kind of new in web development with Java. I am developing a web
Is there any language-independent tutorial or book for developing web applications? For example implementation
Developing a web application that I've registered with Twitter. In this app, I might
I am new to developing web pages. I am looking to create menus similar
When developing web parts in SharePoint can I inherit from the existing web parts

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.