Why doesn't posting data from a User Control work?

G

Guest

I have a usercontrol placed inside a container control on the main form. The user control has an image button plus several text boxes. When I click the button, some sort of activity occurs but the click event in the code behind is never touched. Incidently, the PreRender event with the user control successfully loads dynamic data from a SQL server. I can't explain why this occurrs. Any help is greatly appreciated. Thanks.
 
V

Victor Garcia Aprea [MVP]

Hi Troy,

Are you dynamically adding controls (the UC or any other controls?). By your
explanation it seems like you're adding controls too late thus causing them
to not be available when the firing of events logic runs. Please take a look
here[1] where I include a link to the Control Execution Lifecycle in the
docs plus some insights that should give you a good idea of how dinamically
created controls should be coded with it in mind.

[1] http://weblogs.asp.net/vga/archive/2003/08/11/23498.aspx

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
Troy said:
I have a usercontrol placed inside a container control on the main form.
The user control has an image button plus several text boxes. When I click
the button, some sort of activity occurs but the click event in the code
behind is never touched. Incidently, the PreRender event with the user
control successfully loads dynamic data from a SQL server. I can't explain
why this occurrs. Any help is greatly appreciated. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top