MVP is this a BUG? Adding button element corrupts textbox event!!!

Discussion in 'ASP .Net' started by Kathy Burke, Jul 18, 2003.

  1. Kathy Burke

    Kathy Burke Guest

    Hi, I posted earlier about my textbox textchanged event no longer
    firing. I've found the cause but NOT the reason.

    On a fairly simple aspx form, I added an html button to fire a
    client-side script of open.window. As soon as this was added, the
    textchanged of my textbox no longer fires. I checked that the Handles
    part of the sub statement is still there.

    EVEN WHEN I DELETE THE NEW BUTTON, the problem remains. I see no code
    changes but must revert to a backup to restore the event.

    PLEASE HELP...this is serious problem for me.

    Thanks.

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke, Jul 18, 2003
    #1
    1. Advertising

  2. Hi

    Use the AutoPostBack property to specify whether an
    automatic postback to the server will occur whenever the
    user modifies the text in the TextBox control and then
    tabs out of the control.

    Note:postback only occurs when the text box loses focus
    after the contents are changed.

    HTH
    Ravikanth


    >-----Original Message-----
    >Hi, I posted earlier about my textbox textchanged event

    no longer
    >firing. I've found the cause but NOT the reason.
    >
    >On a fairly simple aspx form, I added an html button to

    fire a
    >client-side script of open.window. As soon as this was

    added, the
    >textchanged of my textbox no longer fires. I checked

    that the Handles
    >part of the sub statement is still there.
    >
    >EVEN WHEN I DELETE THE NEW BUTTON, the problem remains.

    I see no code
    >changes but must revert to a backup to restore the event.
    >
    >PLEASE HELP...this is serious problem for me.
    >
    >Thanks.
    >
    >Kathy
    >
    >*** Sent via Developersdex http://www.developersdex.com

    ***
    >Don't just participate in USENET...get rewarded for it!
    >.
    >
    Ravikanth[MVP], Jul 18, 2003
    #2
    1. Advertising

  3. Kathy Burke

    Kathy Burke Guest

    Thanks for responding...but the autopostback isn't the problem. The
    textbox event worked FINE (fired on user hitting <Enter>) until I added
    a button control and set the onclick to be an open.window script. I
    still need an answer...help!

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke, Jul 18, 2003
    #3
  4. Kathy Burke

    Kathy Burke Guest

    After several hours of hair pulling, finally got it working. It was a
    combination of things. It would only work if I did NOT use an inline
    script in the html button. In the end, for those new users who may have
    a similar problem, I did the following:

    (1) Added the onclick script in the <head> of the html.

    (2) Used an asp:button (vs. html) and put the following code in the page
    load sub (if not postback):

    buttonname.attributes.add("onclick", "name_of_script();return false;")

    the return false will remove/disable the "submit" function that asp.net
    adds in runtime.

    Kathy

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Kathy Burke, Jul 18, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jorge
    Replies:
    2
    Views:
    1,263
    jorge
    May 26, 2004
  2. jorge
    Replies:
    1
    Views:
    411
    Teemu Keiski
    May 28, 2004
  3. jorge
    Replies:
    0
    Views:
    329
    jorge
    May 25, 2004
  4. jorge
    Replies:
    0
    Views:
    259
    jorge
    May 25, 2004
  5. Steven Burn

    Warning: MVP.org is not a Microsoft MVP site

    Steven Burn, Jan 10, 2004, in forum: ASP General
    Replies:
    7
    Views:
    168
    Jeff Cochran
    Jan 12, 2004
Loading...

Share This Page