Re: CheckBox CheckChanged EventHandler not working?
From: Trebek (alextrebek_at_intheformofaquestion.com)
Date: 09/09/04
- Next message: Willy Denoyette [MVP]: "Re: Looking for .NET alternative to the LockWindoxUpdate function"
- Previous message: Willy Denoyette [MVP]: "Re: Passing a "str.basic_string" from C#"
- In reply to: R Reyes: "CheckBox CheckChanged EventHandler not working?"
- Next in thread: R Reyes: "Re: CheckBox CheckChanged EventHandler not working?"
- Reply: R Reyes: "Re: CheckBox CheckChanged EventHandler not working?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 9 Sep 2004 16:45:02 -0400
You have to set the 'AutoPostBack' property to true in order to have your
event fire. Of course, this will cause a post back so you might wanna think
about client-side script instead if you expect high traffic.
HTH,
Alex
"R Reyes" <RReyes@discussions.microsoft.com> wrote in message
news:BAD1ED83-3655-4E5E-9208-B322691D9F76@microsoft.com...
> I have a login page with two checkboxes, one for automatic login and the
> other for remember username. When automatic login is checked, I simply
want
> the remember username checkbox to be checked too, but the eventhandler is
> NEVER executed. do i need to create a different type of event handler?
>
> Here is my code:
> CheckBox cb = new CheckBox();
> cb.ID = "myCheckBox";
> cb.Text = "Remember Username";
> cb.CheckedChanged += new System.EventHandler(this.cb_CheckedChanged);
>
> // this is never executed
> private void cb_CheckedChanged(object sender, EventArgs e) {
> Response.Write ("WE ARE HERE...AWESOME!!!!");
> cbUserNameRemember.Checked = true;
> }
>
> please help. thanks in advance.
- Next message: Willy Denoyette [MVP]: "Re: Looking for .NET alternative to the LockWindoxUpdate function"
- Previous message: Willy Denoyette [MVP]: "Re: Passing a "str.basic_string" from C#"
- In reply to: R Reyes: "CheckBox CheckChanged EventHandler not working?"
- Next in thread: R Reyes: "Re: CheckBox CheckChanged EventHandler not working?"
- Reply: R Reyes: "Re: CheckBox CheckChanged EventHandler not working?"
- Messages sorted by: [ date ] [ thread ]