473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 1902
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
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
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
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
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,...
0
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...

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.