Dynamic button first click doesn"t raise event

Dynamic button first click doesn"t raise event

am 18.01.2008 14:48:13 von William

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.

RE: Dynamic button first click doesn"t raise event

am 18.01.2008 15:24:01 von jignesh

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

Re: Dynamic button first click doesn"t raise event

am 18.01.2008 16:06:35 von William

Hey

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

Thanks


"JIGNESH" wrote in message
news:D98F4CBA-1246-4C10-B165-4B747864235B@microsoft.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.
>>
>>
>>