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
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