What User Control event happens between data binding (other controls) and Render?

I am currently creating a custom control that displays a message when the Repeater is empty.

The idea is simple, give the user control with the repeater ID. When the custom control is displayed, find the repeater and check Items.Count

. If it is zero, display a message.

I would like to add one more function. I want to be able to hide the repeater if there are no items.

Obviously, I can't do this in protected override void Render(HtmlTextWriter writer)

, because the repeater is already (possibly) already rendered. I also cannot do this when a repeater ID is assigned to a custom control, since the data binding has not yet been done.

So my question is, what event can I override in my custom control where the data binding happened but the rendering hasn't .

+1


a source to share


1 answer


Consider the PreRender event. So the binding has happened, but nothing has been done yet, although they are already ready.



+2


a source







All Articles