Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Radiobutton style in html

Reply
Thread Tools

Radiobutton style in html

 
 
MarkShoe
Guest
Posts: n/a
 
      08-04-2008
I currently have a page which has an asp:radiobuttonlist on it as well as a
few html <input type="radio"> elements on it. The problem is that they
don't appear the same; the asp radiobuttons have a green dot in the middle,
and the html ones have a black dot... I would like them both to have the
green dot to be consistent, but I don't want to use the asp radiobutton
control for all of them.

Is there a way I can style my <input type="radio"> to look the same as the
asp:radiobutton ?

Thanks,
Mark

 
Reply With Quote
 
 
 
 
Allen Chen
Guest
Posts: n/a
 
      08-05-2008
Hi Mark,

From your description you get the black dots when using <input
type="radio"/> and get the green dots when using <asp: RadioButtonList>.
However, based on my experience it should not behave like this since <asp:
RadioButtonList> will also be rendered as <input type="radio"/>. The
browser will process these tags in the same way unless a certain style is
specified for either of them.

I would like to show an example here. Please create a new Web Site Project
and paste following code to aspx file:
==================================================

<div>
Input_Radio
<br />
<input type="radio" name="group1" value="item0" />item0
<br />
<input type="radio" name="group1" />item1
<br />
Asp_RadioButtonList
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>item0</asp:ListItem>
<asp:ListItem>item1</asp:ListItem>
</asp:RadioButtonList>
</div>
==================================================

Then view the page. We can see the colors of the dots are same. The color
of the dot of a radio button should be green by default (tested in IE 7 and
FireFox 2 in Windows XP SP2, may vary in other browsers running in
different operating systems).

If we specify a background color for the first radio button and view the
page in IE 7:

<input type="radio" name="group1" value="item0"
style="background-color:#cc0000;"/>item0

We can see the dot is black now.

If we view the page in FireFox 2, however, the green dot is still
displayed. This is caused by the different rendering engine used by
different browsers.

To solve your problem I suggest you to check if styles are applied. You can
remove all the styles/CSS to see if you still get the black dots.

If you still have this problem please send me a demo project. It'll help me
to dig this issue further.

Regards
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
http://www.velocityreviews.com/forums/(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: "MarkShoe" <(E-Mail Removed)>
| Subject: Radiobutton style in html
| Date: Mon, 4 Aug 2008 10:03:01 -0400
| Lines: 4
| Message-ID: <(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain;
| format=flowed;
| charset="iso-8859-1";
| reply-type=original
| Content-Transfer-Encoding: 7bit
| X-Priority: 3
| X-MSMail-Priority: Normal
| Importance: Normal
| X-Newsreader: Microsoft Windows Live Mail 12.0.1606
| X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
| X-MS-CommunityGroup-MessageCategory:
{E4FCE0A9-75B4-4168-BFF9-16C22D8747EC}
| X-MS-CommunityGroup-PostID: {28D76E2F-1972-4E09-9E31-3D6F2728740E}
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontro ls:3888
| NNTP-Posting-Host: TK2MSFTNGHUB02.phx.gbl 127.0.0.1
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| I currently have a page which has an asp:radiobuttonlist on it as well as
a
| few html <input type="radio"> elements on it. The problem is that they
| don't appear the same; the asp radiobuttons have a green dot in the
middle,
| and the html ones have a black dot... I would like them both to have the
| green dot to be consistent, but I don't want to use the asp radiobutton
| control for all of them.
|
| Is there a way I can style my <input type="radio"> to look the same as
the
| asp:radiobutton ?
|
| Thanks,
| Mark
|
|

 
Reply With Quote
 
 
 
 
Allen Chen
Guest
Posts: n/a
 
      08-08-2008
Hi Mark,

Is this problem solved? Please let me know if there is anything that I can
do for you.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| X-Tomcat-ID: 62216839
| References: <(E-Mail Removed)>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (E-Mail Removed) (Allen Chen)
| Organization: Microsoft
| Date: Tue, 05 Aug 2008 08:55:44 GMT
| Subject: RE: Radiobutton style in html
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| Message-ID: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| Lines: 125
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontro ls:3893
| NNTP-Posting-Host: tk5tomimport2.phx.gbl 10.201.218.20
|
| Hi Mark,
|
| From your description you get the black dots when using <input
| type="radio"/> and get the green dots when using <asp: RadioButtonList>.
| However, based on my experience it should not behave like this since
<asp:
| RadioButtonList> will also be rendered as <input type="radio"/>. The
| browser will process these tags in the same way unless a certain style is
| specified for either of them.
|
| I would like to show an example here. Please create a new Web Site
Project
| and paste following code to aspx file:
| ==================================================
|
| <div>
| Input_Radio
| <br />
| <input type="radio" name="group1" value="item0" />item0
| <br />
| <input type="radio" name="group1" />item1
| <br />
| Asp_RadioButtonList
| <asp:RadioButtonList ID="RadioButtonList1" runat="server">
| <asp:ListItem>item0</asp:ListItem>
| <asp:ListItem>item1</asp:ListItem>
| </asp:RadioButtonList>
| </div>
| ==================================================
|
| Then view the page. We can see the colors of the dots are same. The color
| of the dot of a radio button should be green by default (tested in IE 7
and
| FireFox 2 in Windows XP SP2, may vary in other browsers running in
| different operating systems).
|
| If we specify a background color for the first radio button and view the
| page in IE 7:
|
| <input type="radio" name="group1" value="item0"
| style="background-color:#cc0000;"/>item0
|
| We can see the dot is black now.
|
| If we view the page in FireFox 2, however, the green dot is still
| displayed. This is caused by the different rendering engine used by
| different browsers.
|
| To solve your problem I suggest you to check if styles are applied. You
can
| remove all the styles/CSS to see if you still get the black dots.
|
| If you still have this problem please send me a demo project. It'll help
me
| to dig this issue further.
|
| Regards
| Allen Chen
| Microsoft Online Support
|
| Delighting our customers is our #1 priority. We welcome your comments and
| suggestions about how we can improve the support we provide to you.
Please
| feel free to let my manager know what you think of the level of service
| provided. You can send feedback directly to my manager at:
| (E-Mail Removed).
|
| ==================================================
| Get notification to my posts through email? Please refer to
|
http://msdn.microsoft.com/subscripti...ult.aspx#notif
| ications.
|
| Note: The MSDN Managed Newsgroup support offering is for non-urgent
issues
| where an initial response from the community or a Microsoft Support
| Engineer within 1 business day is acceptable. Please note that each
follow
| up response may take approximately 2 business days as the support
| professional working with you may need further investigation to reach the
| most efficient resolution. The offering is not appropriate for situations
| that require urgent, real-time or phone-based interactions or complex
| project analysis and dump analysis issues. Issues of this nature are best
| handled working with a dedicated Microsoft Support Engineer by contacting
| Microsoft Customer Support Services (CSS) at
| http://msdn.microsoft.com/subscripti...t/default.aspx.
| ==================================================
| This posting is provided "AS IS" with no warranties, and confers no
rights.
|
|
| --------------------
| | From: "MarkShoe" <(E-Mail Removed)>
| | Subject: Radiobutton style in html
| | Date: Mon, 4 Aug 2008 10:03:01 -0400
| | Lines: 4
| | Message-ID: <(E-Mail Removed)>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | format=flowed;
| | charset="iso-8859-1";
| | reply-type=original
| | Content-Transfer-Encoding: 7bit
| | X-Priority: 3
| | X-MSMail-Priority: Normal
| | Importance: Normal
| | X-Newsreader: Microsoft Windows Live Mail 12.0.1606
| | X-MimeOLE: Produced By Microsoft MimeOLE V12.0.1606
| | X-MS-CommunityGroup-MessageCategory:
| {E4FCE0A9-75B4-4168-BFF9-16C22D8747EC}
| | X-MS-CommunityGroup-PostID: {28D76E2F-1972-4E09-9E31-3D6F2728740E}
| | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| | Path: TK2MSFTNGHUB02.phx.gbl
| | Xref: TK2MSFTNGHUB02.phx.gbl
| microsoft.public.dotnet.framework.aspnet.webcontro ls:3888
| | NNTP-Posting-Host: TK2MSFTNGHUB02.phx.gbl 127.0.0.1
| | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| |
| | I currently have a page which has an asp:radiobuttonlist on it as well
as
| a
| | few html <input type="radio"> elements on it. The problem is that they
| | don't appear the same; the asp radiobuttons have a green dot in the
| middle,
| | and the html ones have a black dot... I would like them both to have
the
| | green dot to be consistent, but I don't want to use the asp radiobutton
| | control for all of them.
| |
| | Is there a way I can style my <input type="radio"> to look the same as
| the
| | asp:radiobutton ?
| |
| | Thanks,
| | Mark
| |
| |
|
|

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check a html-radiobutton inside a datalist ensingg ASP .Net 0 09-15-2006 01:02 PM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
radiobutton html control Carlos ASP .Net 0 04-08-2005 03:54 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Behavior in CSS style on RadioButton Curtis Koppang ASP .Net 0 12-11-2003 02:01 PM



Advertisments