Problems with RadioButtonList

G

Guest

Hi there. I'm having some fundamental issues using the RadioListButton control. I initialize it with values from from a database when the page load with:

item1 = new ListItem( "listing from database" );
item2 = new ListItem( "listing #2 from database" );
radioButtonList.Items.Add( item1 );
radioButtonList.Items.Add( item2 );

When running it in the debugger after selecting an item and clicking the submit button, the radioButtonList *never* has a selected item. It is quite bizarre. I feel confident there is some minor step that I'm missing. At least I'm hoping that is the case, otherwise this control isn't very usable!! :)

thanks for any tips,

~harris
 
E

Eliyahu Goldin

EnableViewState?

Eliyahu

Harris Reynolds said:
Hi there. I'm having some fundamental issues using the RadioListButton
control. I initialize it with values from from a database when the page
load with:
item1 = new ListItem( "listing from database" );
item2 = new ListItem( "listing #2 from database" );
radioButtonList.Items.Add( item1 );
radioButtonList.Items.Add( item2 );

When running it in the debugger after selecting an item and clicking the
submit button, the radioButtonList *never* has a selected item. It is quite
bizarre. I feel confident there is some minor step that I'm missing. At
least I'm hoping that is the case, otherwise this control isn't very
usable!! :)
 
T

Thomas Dodds

only fill the listitems if the page is not posted back ...

Harris Reynolds said:
Hi there. I'm having some fundamental issues using the RadioListButton
control. I initialize it with values from from a database when the page
load with:
item1 = new ListItem( "listing from database" );
item2 = new ListItem( "listing #2 from database" );
radioButtonList.Items.Add( item1 );
radioButtonList.Items.Add( item2 );

When running it in the debugger after selecting an item and clicking the
submit button, the radioButtonList *never* has a selected item. It is quite
bizarre. I feel confident there is some minor step that I'm missing. At
least I'm hoping that is the case, otherwise this control isn't very
usable!! :)
 

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

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top