Problems with RadioButtonList

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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!! :-)
 
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!! :-)
 
Back
Top