Print Page | Close Window

RadioButtonList Control

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=13769
Printed Date: 28 March 2026 at 9:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: RadioButtonList Control
Posted By: Misty
Subject: RadioButtonList Control
Date Posted: 11 February 2005 at 2:01am
I am not happy with the way a couple of radio buttons look. I used the RadioButtonList Control.
 
Here's my code:
<tr>
                &nbs p;       <td height="42" align="right" valign="top" bgcolor="#e8e8e8"><font face="MS Sans Serif, Arial" size="2" color="#000000"><strong><nobr>
                &nbs p;         Show Email Address?</nobr></strong></font></td>
            <td colspan="2" valign="top" bgcolor="#e8e8e8"> <p>            
            <asp:RadioButtonList id=radShowEmail runat="server" Columns="30">
            <asp:ListItem Value="0" selected="True">Yes</asp:ListItem>
            <asp:ListItem Value="1">No</asp:ListItem>
          
        </asp:RadioButtonList>
         </p></td></tr>
 
Here's how it looks:
Show Email Address?

< id=radShowEmail_0 = value=0 name=radShowEmail>
< id=radShowEmail_1 = value=1 name=radShowEmail>

 
I would like for No to be right of Yes. How do I work around this? I had no problem in Classic ASP.



Replies:
Posted By: michael
Date Posted: 11 February 2005 at 3:54pm
The RadioButton List control has a Property for either Table Layout or Flow Layout. Change it to flow as it defaults to table.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Misty
Date Posted: 11 February 2005 at 4:11pm
How do you set it to Flow Layout? Thanks!


Posted By: Mart
Date Posted: 11 February 2005 at 5:23pm
RadioButtonList1.RepeatLayout = RepeatLayout.Flow


Posted By: michael
Date Posted: 11 February 2005 at 7:58pm
or you actually set it as a property in the designer. It's one of the properties of the property window

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Misty
Date Posted: 12 February 2005 at 1:40am
Originally posted by Mart Mart wrote:

RadioButtonList1.RepeatLayout = RepeatLayout.Flow
 
Mart, I tried doing what you suggested. I got the following error message:
 
Parser Error Message: The server tag is not well formed.

Source Error:

Line 382:                          Show Email Address?</nobr></strong></font></td>
Line 383:            <td colspan="2" valign="top" bgcolor="#e8e8e8"> <p>             
Line 384:            <asp:RadioButtonList1.RepeatLayout = RepeatLayout.Flow id=radShowEmail runat="server" Columns="30"> 
Line 385:            <asp:ListItem Value="0" selected="True">Yes</asp:ListItem> 
Line 386:            <asp:ListItem Value="1">No</asp:ListItem> 
 
Originally posted by michael michael wrote:

or you actually set it as a property in the designer. It's one of the properties of the property window
 
Michael, I am new at Visual Studio .Net. I use notepad to edit my code a lot. Can you please explain how to do this? I tried finding it in Visual Studio .Net.


Posted By: Mart
Date Posted: 12 February 2005 at 5:11am
http://www.devjunkies.com/feed/vs.jpg - http://www.devjunkies.com/feed/vs.jpg

If you can't see the properties pane, View > Properties...


Posted By: Misty
Date Posted: 12 February 2005 at 2:17pm
I was able to get the properties window up. However, I cannot get the web page do display Design and HTML tabs at the bottom. How do I get them to display?  I clicked on ToolBars under View. I clicked on Design and HTML Editor.


Posted By: Mart
Date Posted: 12 February 2005 at 2:21pm
Just double click your aspx file in Solution explorer and it will pop up


Posted By: Misty
Date Posted: 12 February 2005 at 3:18pm
I finally figured out how to use Visual Studio .Net the way I wanted to with this web page. My code for this radio button is: <tr>
      <td height="42" align="right" valign="top" bgcolor="#e8e8e8"><font face="MS Sans Serif, Arial" size="2" color="#000000"><strong><nobr>
          Show Email Address?</nobr></strong></font></td>
      <td colspan="2" valign="top" bgcolor="#e8e8e8">
       <p>
        <asp:RadioButtonList id="radShowEmail" runat="server" Columns="30" RepeatLayout="Flow">
         <asp:ListItem Value="0" Selected="True">Yes</asp:ListItem>
         <asp:ListItem Value="1">No</asp:ListItem>
        </asp:RadioButtonList>
       </p>
      </td>
     </tr>
There's no error mesage now. But it is still not displaying the radio buttons. I want the yes radio button and no radio button to be on the same line. Maybe I'm missing something in my code.


Posted By: michael
Date Posted: 12 February 2005 at 11:28pm

<asp:RadioButtonList id="RadioButtonList1" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow">
    <asp:ListItem Value="yes">yes</asp:ListItem>
    <asp:ListItem Value="no">no</asp:ListItem>
   </asp:RadioButtonList>



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Misty
Date Posted: 13 February 2005 at 2:48pm
Michael, Thank you! It worked.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net