Using a RadioButtonList Server Control in a Composite Control

G

Greg Larden

Hi There,

I have a composite server control that wrapps a RadiobuttonList. Which
is populate from a Collection of Objects.

The control is rendered and populated with data properly. On post back
it redraws itself with preserving the selection from the user. But I
can not figure out how to retrieve which radiobutton was selected.

I've created a public property in my Composite Control to expose the
private member "_radiobuttonlist" but the selected value is null on
postback.

I'm totally stumped :|
 
S

sam

Make sure that you are building your control tree *completely* - from
your radio button list all the way to the main Page object - by the
time Page_Init or Page_Load executes.

This will cause your problem if you don't do this. Usually
EnsureChildControls() is called from Page_Init() - or OnInit()
whichever you use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top