473,383 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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.
Jan 18 '08 #1
2 5188
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.
Jan 18 '08 #2
Hey

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

Thanks
"JIGNESH" <JI*****@discussions.microsoft.comwrote in message
news:D9**********************************@microsof t.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.

Jan 18 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Jonathan Yong | last post by:
I observe a very weird behavior when dynamically create web control and bind events to it. Create a C# ASP.NET application, Put a PlaceHolder and Textbox onto the Web form, and try with the 4...
1
by: Shourie | last post by:
I've noticed that none of the child controls events are firing for the first time from the dynamic user control. Here is the event cycle. 1) MainPage_load 2) User control1_Load user clicks a...
1
by: Peter Wu | last post by:
Hello Group, I create a class that inherits from the System.Web.UI.WebControls.DataGrid class. Basically, what I want to do is to dynamically add a Table that contains some numbers for paging....
1
by: Steve Booth | last post by:
I have a web form containing a button that when selected adds a user control to a place holder. The user control contains a button. The first time the user control is added the contained button...
4
by: Bass Pro | last post by:
Hi, I am creating textbox, radiobuttonlist and checkboxlist dynamically depending on data from a table. It is a questionnaire. I add the control on a Panel control during the 1st load_page event....
3
by: PJ6 | last post by:
I've added a button to a class inheriting from System.Web.UI.Control and want to handle (pass on) its click event to the page that contains it. Coming from a WinForms background, I thought this...
4
by: EvelynAnd Ethan | last post by:
Hi, ItemCommand event not firing from a dynamic user control ,WHERE A DATAGRID HAS BUTTON,when i click on the linkbutton first time the itemcommand event doesnt fire,second time event fires up ...
4
by: =?Utf-8?B?c21heQ==?= | last post by:
I'm trying to raise the click event of a button from my Page_Load event so that after the Page_Load completes the myBtn_Click event is fired, just as if a user had clicked the button. I can't just...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.