user control inside another usercontrol inserted dynamicaly

2.3k views Asked by At

I have a engine that build pages form me (must be) called engine.aspx. I just point a user control and the engine.aspx build for me everything that I need. But this time, I have to put another userControl inside the main user control. If I open the control in a normal aspx, everything works fine! But if I try to open with the engine, the event of the second control does not work. Does anyone knows Why?


I'm adding the first control this way:

form.Controls.add(controlName);

The second Control already in the first.

1

There are 1 answers

0
competent_tech On

Welcome to SO!

A couple of things to check:

  1. Ensure the controls are being loaded in the Init event of the Page so that it is initialized correctly.

  2. I'm not sure how you are getting the control, but you may need to call LoadControl before adding it.

  3. Ensure that the control has an ID assigned before adding it.

  4. I always ensure that EnableViewState is set to true before adding the control, but this may or may not be necessary in your case.