ASP RadioButton Value?

I added group of  <asp:RadioButton> to my page, set it's text value and then went to set the value property but apparently there is no value property.  (huh???)

RadioButtonList doesn't work for me because I wish to style my 10 RadioButtons in 2 columns and 5 rows versus having them all stack up vertically.  (unless there is a way to do this that I'm not aware of)

So I'm confused.  RadioButtonList allows me to assign values but a plain old RadioButton does not.  

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
Great isn't it! Two steps forward and one step back and all that.

Anyway, like you've already said you'll have to resort to a RadioButtonList (or use some convoluted mapping behind the scenes) if you want to supply a value. Luckily the RadioButtonList will allow you to put the radio buttons into columns using the RepeatColumns and RepeatDirection properties.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
A <asp:RadioButton> is nothing more than the ASP.NET representation of an <input type="radio">. It has bells and whistles hung on it, but in essense it has not value property because this is actually set by the text property (they should have named the text property "value" to be more clear).

A <asp:RadioButtonList> allows for text and value properties because it builds labels for each <input> it builds, assigning Text to the label and Value to the <input>. in short it makes sense that there is no text & value property.

To make a <asp:RadioButtonList> behave in the way you described you can set the RepeatDirection and RepeatColumns properties (Note: there is also a RepeatLayout property that will control whether it renders a <table> or using <div> tags.

So you can do this to get two columns, hope that helps:
<asp:RadioButtonList ID="rb1" runat="server" RepeatDirection="Horizontal" RepeatColumns="2">
      <asp:ListItem Text="rb1" Value="1"></asp:ListItem>
      <asp:ListItem Text="rb2" Value="2"></asp:ListItem>
      <asp:ListItem Text="rb3" Value="3"></asp:ListItem>
      <asp:ListItem Text="rb4" Value="4"></asp:ListItem>
      <asp:ListItem Text="rb5" Value="5"></asp:ListItem>
      <asp:ListItem Text="rb6" Value="6"></asp:ListItem>
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.