views:

10

answers:

0

Can anyone explain to me in a brief nutshell how to programatically add controls into a templated control and just as importantly handle the events raised by these new controls.

I'm not building a templated control from scratch, but inheriting from the repeater, to add paging and sorting functionality above and below the native output.

I have been experimenting with outputting the controls using Controls.Add() as well as xxx.RenderControl() but seem to be getting controls appearing on load and then others appearing on postback so I've obviously got something wrong.

I'm used to working within the page itself and relying on the model there where controls are statically added to the page and always exist. I'm guessing I need to more attentively manage viewstate but am not sure of where to start.

Many Thanks