Solved

Help Styling ASP RadioButtonList

Posted on 2009-04-13
4
395 Views
Last Modified: 2012-06-21
Hi guys- This seems easy but for some reason I am struggling with this one radio button list. Can't figure out what makes it different from all the others in other pages that use almost identical code. See the attached screenshot. It aligns left. I have tried setting aliggnment in <tr> tag, in <td> tag, is the control itself, and using CSS Class. Can't get it to center. Can anyone tell me what I am missing? Your help would be greatly appreciated.

HTML:
 
                            <tr>
                              
                            <asp:Panel ID="pnlPhoneType" runat="server" Visible="false">
                               <td>
                                    <asp:RadioButtonList ID="rdblPhone" runat="server" RepeatDirection="Horizontal" >
                                    <asp:ListItem>Home</asp:ListItem>
                                    <asp:ListItem Value="Cell"></asp:ListItem>
                                    <asp:ListItem>Work</asp:ListItem>
                                    </asp:RadioButtonList> 
                                </td>
                                <td>
                                    <asp:RequiredFieldValidator ID="rfvrdblPhone" runat="server" ControlToValidate="rdblPhone" ErrorMessage="Please Select The Type Of Phone">*</asp:RequiredFieldValidator>
                                </td>
                            </asp:Panel>
                            </tr>

Open in new window

radioButtonsLeft.jpg
0
Comment
Question by:ksnider
  • 2
4 Comments
 
LVL 19

Expert Comment

by:daveamour
ID: 24135506
Can you show me the rendered html of the page?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 24137726
"I have tried setting alignment in <tr> tag, in <td> tag"
How did you try setting the alignment values?
0
 
LVL 19

Accepted Solution

by:
daveamour earned 125 total points
ID: 24137760
You have it in the left cell.  Do you just want it over in the second cel ie like this:
                            <asp:Panel ID="pnlPhoneType" runat="server" Visible="false">
                               <td>
                                   &nbsp;
                                </td>
                                <td>
                                    <asp:RadioButtonList ID="rdblPhone" runat="server" RepeatDirection="Horizontal" >
                                    <asp:ListItem>Home</asp:ListItem>
                                    <asp:ListItem Value="Cell"></asp:ListItem>
                                    <asp:ListItem>Work</asp:ListItem>
                                    </asp:RadioButtonList>

                                    <asp:RequiredFieldValidator ID="rfvrdblPhone" runat="server" ControlToValidate="rdblPhone" ErrorMessage="Please Select The Type Of Phone">*</asp:RequiredFieldValidator>
                                </td>
                            </asp:Panel>
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

830 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