hi all of u
i need the code for this one
counting the button clicks in one minute ,,that code should be c#.net
and timer is also included for time setting........count the button clicks in one minute
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted May 31, 2011, 3:54 AM EDT
Have a global variable "clickCount".
Start the timer.
Increment clickCount in On mouse click event.
if timer reaches 1 min then stop it and display the clickCount.
Reset clickCount to 0.
Start the timer...
...
...
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 4:14 AM EDT
Don't forgot to set Timer interval to 60000 if you are doing on your own
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:18 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 4:19 AM EDT
Sandeep ShekhawatRank #2,439 · 577 reputationPosted May 31, 2011, 4:30 AM EDT
protected void Button_Click(object sender, EventArgs e)
{
btncount+=1; //every click event value increment
}
//Timer is
Timer Tick Event
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:39 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 4:41 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:43 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 4:44 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:47 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 4:49 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:49 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:56 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 4:58 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:03 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:04 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:05 AM EDT
Static int click=0;
protected void Button1_Click(object sender, EventArgs e)
{
click++;
TextBox1.Text = click.ToString();
}
protected void Timer1_Tick(object sender, EventArgs e)
{
Response.Write("Total Count:{0}'"+click+"'");
}
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:10 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:11 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:12 AM EDT
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:14 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:15 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:20 AM EDT
protected void Timer1_Tick(object sender, EventArgs e)
{
Response.Write("Total Count:{0}'"+click+"'");
click=0;
}
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:24 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:26 AM EDT
Sandeep ShekhawatRank #2,439 · 577 reputationPosted May 31, 2011, 5:27 AM EDT
protected void Button_Click(object sender, EventArgs e)
{
btncount+=1; //every click event value increment
}
//Timer is
Timer Tick Event
int time=0;
Try This it will be helpful.
But Remember some point:
1.Value type variable always intiliazed.
2.Ajax Extensions Controls Like Timer,Update panel uses with Script Manager.
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:29 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:31 AM EDT
Count each and every button click and store
After one minute you have to show how many times you have clicked the button and want to show right
bhanu prasannakumar123 reputationPosted May 31, 2011, 5:33 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:37 AM EDT
Dorababu MekaRank #457 · 5.5K reputationPosted May 31, 2011, 5:41 AM EDT
I modified time interval for 10 seconds
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts