?
Solved

Radio Button in User Control

Posted on 2010-09-08
4
Medium Priority
?
660 Views
Last Modified: 2012-05-10
Hi..
I have user control that has a single radio button.  My page loads the control(s) but depending on the data and loads more than 1 of the same control.. up to 5.  My problem is that after the controls are loaded the radio buttons are not in 'synch'  - I can select multiple values - I need to controls to act like 1 single radio group so only 1 button of the controls can be selected.
Any ideas
thanks

0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 38

Expert Comment

by:Tom Beck
ID: 33625734
Giving all the radio buttons the same name attribute should group them.
0
 
LVL 1

Author Comment

by:JElster
ID: 33625805
I tried that - I thought it should work too...

    <asp:RadioButton ID="radDEFAULTADDRESS" runat="server" ForeColor="Black" Name="grpAddress" Text="Default Address" TabIndex="-1" />
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 2000 total points
ID: 33626106
Actually it shoud be GroupName="grpAddress", but it still does not work because each radio button group name is prefixed with an id, and the id will always be unique. Even if you do not assign a group name, one is automatically rendered for each radio button added via the same user control.

One possibility is to use a standard html input radio button with a group name in the user control. Then upon submit, use javascript to determine which one is checked.
0
 
LVL 1

Author Comment

by:JElster
ID: 33626181
I found this.. which I think does it....

http://www.codeproject.com/KB/webforms/How_group_RButtons.aspx
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month8 days, 20 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question