469,927 Members | 1,382 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Events firing twice

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
Sep 21 '06 #1
0 1038

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Kory Pukash | last post: by
1 post views Thread by John Martin | last post: by
3 posts views Thread by Mike | last post: by
5 posts views Thread by Paal Berggreen | last post: by
20 posts views Thread by David Levine | last post: by
4 posts views Thread by Marc Solé | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.