473,480 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create 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 1905
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
5640
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
1540
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
2590
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
5493
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
7700
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
9634
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
3983
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
6970
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
2624
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
7039
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7080
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...
0
6895
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...
0
5326
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4770
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
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1296
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
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.