Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 90625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:54:09+00:00 2026-05-10T22:54:09+00:00

I got a templated control (a repeater) listing some text and other markup. Each

  • 0

I got a templated control (a repeater) listing some text and other markup. Each item has a radiobutton associated with it, making it possible for the user to select ONE of the items created by the repeater.

The repeater writes the radiobutton setting its id and name generated with the default ASP.NET naming convention making each radiobutton a full ‘group’. This means all radiobuttons are independent on each other, which again unfortunately means I can select all radiobuttons at the same time. The radiobutton has the clever attribute ‘groupname’ used to set a common name, so they get grouped together and thus should be dependant (so I can only select one at a time). The problem is – this doesn’t work – the repeater makes sure the id and thus the name (which controls the grouping) are different.

Since I use a repeater (could have been a listview or any other templated databound control) I can’t use the RadioButtonList. So where does that leave me?

I know I’ve had this problem before and solved it. I know almost every ASP.NET programmer must have had it too, so why can’t I google and find a solid solution to the problem? I came across solutions to enforce the grouping by JavaScript (ugly!) or even to handle the radiobuttons as non-server controls, forcing me to do a Request.Form[name] to read the status. I also tried experimenting with overriding the name attribute on the PreRender event – unfortunately the owning page and masterpage again overrides this name to reflect the full id/name, so I end up with the same wrong result.

If you have no better solution than what I posted, you are still very welcome to post your thoughts – at least I’ll know that my friend ‘jack’ is right about how messed up ASP.NET is sometimes 😉

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:54:10+00:00Added an answer on May 10, 2026 at 10:54 pm

    Google-fu: asp.net radiobutton repeater problem

    Indeed an unfortunate consequence of the id mangling. My take would be creating a – or picking one of the many available – custom control that adds support for same name on the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a repeater control containing comments. I'm about to implement ajax paging to
I had some site templates designed for me recently. I got the final HTML
Has anyone got EclipseLink MOXy (I'm using eclipselink 2.1.0) to work with Java 5?
I have got a template class as follows: class MyClass<T> { T field; public
I discovered template metaprogramming more than 5 years ago and got a huge kick
We've got a .net CMS running on IIS 6 which uses XSLT templates. It
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
got a new blog at wordpress few days ago ( http://ghads.wordpress.com ) and I
Got a class that serializes into xml with XMLEncoder nicely with all the variables
Got myself in a bit of a pickle here ... working on a CMS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.