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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:43:01+00:00 2026-05-29T21:43:01+00:00

I am using ASP.net in my project. I Declare a Variable btn_clik, tot at

  • 0

I am using ASP.net in my project.

I Declare a Variable btn_clik, tot at the beginning of Class.

 public partial class Table : System.Web.UI.Page
    {
        public int btn_click = 1, tot = 0;

I have two button, Up And Down. When I click Up button btn_click variable want to decrease. And Down Button btn_click variable want to increase.

 protected void btnUp_Click(object sender, EventArgs e)
 {
            if (btn_click != 1) { btn_click--;}              
 }

 protected void btnDown_Click(object sender, EventArgs e)
 {
       if (btn_click < tot) { btn_click++;}               
 }

But At the Page load,.. btn_click vale is 1; then I Click Down Button,.. btn_click value is 2. I repeat the Down Button Click,.. But btn_click value is still 2; I Check that with breakpoints. Each Time btn_click Variable is going to 1, At that time of Button Click.

What is the Mistake…

  • 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-29T21:43:03+00:00Added an answer on May 29, 2026 at 9:43 pm

    ASP.Net instances do not persist across HTTP requests.
    Each requests gets a new instance of your page class.

    You need to store the value in session state or viewstate.

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

Sidebar

Related Questions

There's a sample ASP.NET project with this controller: using System; using System.Collections.Generic; using System.Web;
I am using an ASP.NET MVC project and everytime I add a class to
I am using ASP.NET Dynamic Data for a project and I have a table
I am using a class in a C# ASP.NET project to allow a script
I have a class called MembershipHelper, which I am using in my ASP.NET project.
I have a web project using asp.net mvc3. Now clients ask for a security
I'm using a asp.net web application project, and I cannot access any asp:content controls
Im using a asp.net 4.0 project. My file structure looks like this RootSite  -Web.Config
I am using ASP.NET Dynamic Data Entities project to generate a web application for
I am using jQuery with ASP.NET in a project. Instead of using ASP.NET Ajax,

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.