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

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
Back
Top