Re: CheckBox CheckChanged EventHandler not working?

From: R Reyes (RReyes_at_discussions.microsoft.com)
Date: 09/09/04


Date: Thu, 9 Sep 2004 14:47:02 -0700

Oh really? That stinks. I'm not expecting high traffic but I didn't realize
you had to have a page submit for a function as easy as this to work. Ugh, I
was hoping I wouldn't need to have any client side scripting. I didn't
really want to use javascript/vbscript. I like handling everything in
c#...at least ever since i've converted. And I guess it was assuming too
much that an event handler would be able to change stuff on a webform w/o the
need to submit. But...I guess that does make sense.

Thanks Trebek. And if anyone has any other ideas besides client-side
scripting, I'm all ears.

"Trebek" wrote:

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



Relevant Pages

  • Re: button.disabled - firefox vs IE difference
    ... This way users will be able to submit without client-side ... Use the `onsubmit' event handler of the `form' element, ... by calling a validation function instead of this ... Use server-side sessions, so you can detect server-side if data has been ...
    (comp.lang.javascript)
  • Re: how to Enable/Disable textbox dynamically
    ... If you need a client-side solution, don't post server-side code ... and must not occur as child of the `html' element. ... it escapes me why you are relying on client-side scripting this ...
    (comp.lang.javascript)
  • Re: Function call
    ... the event handler should consist of some valid code ... This assertion is not true when assigning a handler through scripting. ... Unsolicited commercial email will be read at a cost of $500 per message. ... question is worth asking, it's worth posting. ...
    (microsoft.public.scripting.jscript)
  • Re: POST Method
    ... the more important concern is of no client-side scripting support. ... Navigation should never depend on a script where scripting engine availability and compatibility can't be assured or the exclusion of clients to whom the scripting functionality will be unavailable causes undue harm. ... Publicly accessible site with a "normal" distribution of browsers including the most recent versions of Mozilla and IE as well as older versions and more obscure browsers. ...
    (comp.lang.php)
  • Re: strange html table behavior
    ... Also it is a *very bad* idea to rely on *client-side* scripting to load your page, about 10% have JavaScript disable and they too will get a beautiful black white page! ... Since you are on a IIS server you should use server-side ASP or SSI. ...
    (alt.html)