newbie question on cssclass

D

Danny Ni

Hi,

I have the following on an aspx page:
<asp:RadioButton ID="RadioButton1" runat="server" cssclass="radio"
Text="Radio 1"/>

This render as:
<span class="radio"><input id="RadioButton1" type="radio"
name="RadioButton1" value="RadioButton1" /></span>

in IE. It does not work with our existing csss. The graphic designer is
expecting this instead:
<input id="RadioButton1" type="radio" name="RadioButton1"
value="RadioButton1" class="radio" />

Can anyone suggest how to resole this? I already try <input type="radio"
runat="server">, but it does not support AutoPostBack attribute

TIA
 
R

Rain

In what way does this not work ? You can include a style called radio and
set the properties of the radio button just fine.
Well, it works on IE 7 anyway. What browser are u using ?
 
I

Ignacio Machin ( .NET/ C# MVP )

Hi,

I have  the following on an aspx page:
<asp:RadioButton ID="RadioButton1" runat="server" cssclass="radio"
Text="Radio 1"/>

This render as:
<span class="radio"><input id="RadioButton1" type="radio"
name="RadioButton1" value="RadioButton1" /></span>

in IE. It does not work with our existing csss. The graphic designer is
expecting this instead:
<input id="RadioButton1" type="radio" name="RadioButton1"
value="RadioButton1" class="radio" />

Can anyone suggest how to resole this? I already try <input type="radio"
runat="server">, but it does not support AutoPostBack attribute

TIA

Hi,

If you noticed an ASP.NET RadioButton is translated in TWO HTML
elements, a SPAN and the INPUT. If you want to change the INPUT you
have to do it like:
rButton1.InputAttributes.Add("Class", "MyClass");
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top