Events firing twice

T

tshad

I am curious as to why my events from my radio buttons are executing twice?

I am using VS 2003 and the event declaration is:

private void InitializeComponent()
{
this.Button3.Click += new System.EventHandler(this.Button3_Click);
this.NewBatches.CheckedChanged += new
System.EventHandler(this.NewBatches_CheckedChanged);
this.AllBatches.CheckedChanged += new
System.EventHandler(this.AllBatches_CheckedChanged);
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);

}

My Code is:
****************************
private void FillPayDatesDrop()
{
CheckForBatches();
}
private void CheckForBatches()
{
int ktr = 0;
}

public void NewBatches_CheckedChanged(object sender, System.EventArgs e)
{
FillPayDatesDrop();
}

public void AllBatches_CheckedChanged(object sender, System.EventArgs e)
{
FillPayDatesDrop();
}
*****************************

When I put debug it, it does the following:
1. I can see it going to one of the 2 buttons events
(NewBatches_CheckChanged for example).
2. It goes to FillPayDatesDrop()
3. It goes to CheckForBatches()
4. It goes to the same event from number 1.
5. It goes to FillPayDatesDrop()
6. It goes to CheckForBatches()
7. Goes on normally.

It does this every time.

Why does it do that and how do I stop it?

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top