PC Review


Reply
Thread Tools Rate Thread

Dynamic button first click doesn't raise event

 
 
William
Guest
Posts: n/a
 
      18th Jan 2008
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.


 
Reply With Quote
 
 
 
 
JIGNESH
Guest
Posts: n/a
 
      18th Jan 2008
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.
>
>
>

 
Reply With Quote
 
William
Guest
Posts: n/a
 
      18th Jan 2008
Hey

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

Thanks


"JIGNESH" <(E-Mail Removed)> wrote in message
news98F4CBA-1246-4C10-B165-(E-Mail Removed)...
> 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.
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to raise by code the click event of a button in C# polocar Microsoft C# .NET 2 3rd Nov 2006 03:20 PM
How to raise an event of button (click event) from textbox's onkeydown event? ABC Microsoft Dot NET Framework Forms 2 25th Jul 2006 11:19 AM
An event raise twice when click the button. David Microsoft Outlook Program Addins 0 16th Jul 2006 12:25 PM
An event raise twice when click the button. OS538DAV Microsoft Outlook Program Addins 0 16th Jul 2006 12:22 PM
Hit button does not raise click event =?Utf-8?B?UGFzY2Fs?= Microsoft Dot NET Framework Forms 0 23rd Mar 2004 09:21 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:13 PM.