473,508 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with RadioButtonList

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
Nov 18 '05 #1
2 1910
EnableViewState?

Eliyahu

"Harris Reynolds" <Ha************@discussions.microsoft.com> wrote in
message news:9E**********************************@microsof t.com...
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

Nov 18 '05 #2
only fill the listitems if the page is not posted back ...

"Harris Reynolds" <Ha************@discussions.microsoft.com> wrote in
message news:9E**********************************@microsof t.com...
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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5644
by: Hazzard | last post by:
I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar) I am creating an edit functionality on the asp.net form so that when I reuse my...
0
1546
by: Niks | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary...
3
2592
by: Arun K | last post by:
Hi, I am creating a simple .aspx page to add some fields with validation. I have used different .NET validations like REquiredFieldValidator, RegularExpressionValidator and showed the summary...
5
5498
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 --...
6
7705
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
4
9641
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
4
3989
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
5
6975
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the...
6
2627
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7388
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7499
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3186
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
767
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.