TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Charlotte Wahlstedt
NA
1
23.6k
Check if button is already clicked C#
May 7 2014 3:16 PM
I'm building a web application i Visual Studio using C#.
I need to check if it is the first time a button is clicked. If it is the first time I want to pick variables from one place. If it is not the first time I want to pick variable from another place.
I tried using a class Click
namespace myProject
{
public class Click
{
public int buttonclick = 0;
}
}
In button click:
Click.buttonclick++;
if (Click.buttonclick == 1)
{
MessageBox.Show("First click");
}
else
MessageBox.Show("Other clicks");
This code works the first time the web form is visited. If I go to another page and then return to this page the variable does not resets to zero. I need the variable to reset to zero every time page is visited. Is there another solution for this?
Reply
Answers (
2
)
burglary Bayesian network
Export Windows Form into a Word document without databse