By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

INamingContainer has change my controls event order.....

P: n/a
Hi All,

I have built a composite user web control and I've NOT implemented
INamingContainer.
It does implement IPostBackDataHandler to retrieve information entered into
the controls when the host page is submitted.

In the controls LoadPostData event, I retrieve the information entered and
act upon.
The information entered affects the way the control is rendered, so in the
controls CreateChildControls event, I build the objects as they should be
based, on the information the user entered and submitted.

Once I put the control onto a web form it worked fine in isolation, but once
I added other controls to the host page it fell over with the error:
"Multiple controls with the same ID '_ctl1' were found. FindControl requires
that controls have unique IDs."

Fair enough, so I go to my control and Implement INamingContainer so that it
prefixes all the controls within my user control with the main controls
name.
However, this effected another change. The LoadPostData event is now
executed after the CreateChildControls event. This means that I can't render
the control based on what was retrieved in the LoadPostData event????

This seems like a fairly sensible thing to do, so why when implementing
INamingContainer do the control base events change order???
How do I render the controls objects based on information retrieved in the
LoadPostData event????

Thanks

Alex
Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.