Dynamic button first click doesn't raise event

Discussion in 'ASP .Net' started by William, Jan 18, 2008.

  1. William

    William Guest

    Hi

    I've created a page with only 'n blank table control on it. When clicking a
    button, the table populates with various textboxes and dropdown lists to
    make up a complete form. In the last row of the table, a submit button is
    added.

    Almost everything works fine. The form display, the user fills out the form
    and then click Submit. However, the first time the submit button is
    clicked, the Click event isn't raised. Just a simple postback is done.
    When clicking the submit button again, the code is executed and the captured
    results are saved.

    I need to get the system to execute the code on the first click to avoid
    possible confusion among users.
    William, Jan 18, 2008
    #1
    1. Advertising

  2. William

    JIGNESH Guest

    Did you created the button click event handler also at runtime?
    eg: Button.Click += .......

    Regards
    JIGNESH

    "William" wrote:

    > Hi
    >
    > I've created a page with only 'n blank table control on it. When clicking a
    > button, the table populates with various textboxes and dropdown lists to
    > make up a complete form. In the last row of the table, a submit button is
    > added.
    >
    > Almost everything works fine. The form display, the user fills out the form
    > and then click Submit. However, the first time the submit button is
    > clicked, the Click event isn't raised. Just a simple postback is done.
    > When clicking the submit button again, the code is executed and the captured
    > results are saved.
    >
    > I need to get the system to execute the code on the first click to avoid
    > possible confusion among users.
    >
    >
    >
    JIGNESH, Jan 18, 2008
    #2
    1. Advertising

  3. William

    William Guest

    Hey

    Found the problem.
    Needed to assign a value to the btnSubmit.ID.

    Thanks


    "JIGNESH" <> wrote in message
    news:D...
    > Did you created the button click event handler also at runtime?
    > eg: Button.Click += .......
    >
    > Regards
    > JIGNESH
    >
    > "William" wrote:
    >
    >> Hi
    >>
    >> I've created a page with only 'n blank table control on it. When
    >> clicking a
    >> button, the table populates with various textboxes and dropdown lists to
    >> make up a complete form. In the last row of the table, a submit button
    >> is
    >> added.
    >>
    >> Almost everything works fine. The form display, the user fills out the
    >> form
    >> and then click Submit. However, the first time the submit button is
    >> clicked, the Click event isn't raised. Just a simple postback is done.
    >> When clicking the submit button again, the code is executed and the
    >> captured
    >> results are saved.
    >>
    >> I need to get the system to execute the code on the first click to avoid
    >> possible confusion among users.
    >>
    >>
    >>
    William, Jan 18, 2008
    #3
    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. Purvi T
    Replies:
    0
    Views:
    829
    Purvi T
    Oct 19, 2004
  2. Oney
    Replies:
    2
    Views:
    4,406
    Natty Gur
    May 17, 2004
  3. Chu
    Replies:
    2
    Views:
    902
    Winista
    Apr 10, 2006
  4. Amy
    Replies:
    0
    Views:
    974
  5. Max2006
    Replies:
    2
    Views:
    1,564
    Walter Wang [MSFT]
    Sep 19, 2007
Loading...

Share This Page