views:

25

answers:

1

hi all,

I have a usercontrol that acts as a container to hold more usercontrols within it.

I need to perform certain access checks once all of the child controls have databound.

I was hoping I could attach to a usercontrol.databound event but there does not seem to be one.

What other options do I have to do something on the parent usercontrol once the other usercontrols have databound. I assume I have to get the child controls to notify the parent they have databound and the parent will need to track which have databound and which have not and when they all have databound it can peform its action.

A: 

You don't need to get the child controls to notify the parent. Look at the ASP.Net Page :Life Cycle. You need to put the code in the container user control in the PreRender event. This executes after the postback events.

TheGeekYouNeed
I was considering putting it in the pre-render as a last resort. We have had bad experiences with doing this kind of thing in pre-render before but I think that was mainly because one god class controlled all of the logic rather than per control having the logic for what it needed.
Daniel