Dynamic button first click doesn't raise event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William

    Dynamic button first click doesn't raise event

    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.


  • =?Utf-8?B?SklHTkVTSA==?=

    #2
    RE: Dynamic button first click doesn't raise event

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

    Comment

    • William

      #3
      Re: Dynamic button first click doesn't raise event

      Hey

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

      Thanks


      "JIGNESH" <JIGNESH@discus sions.microsoft .comwrote in message
      news:D98F4CBA-1246-4C10-B165-4B747864235B@mi crosoft.com...
      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.
      >>
      >>
      >>

      Comment

      Working...