ASP:RadionButtonList Restricted In A Single Cell?

C

Chan

I'd like to place some radio buttons across a row of different <td>
inside of a <tabl>, such as:

-----------------------------
| radio1 | radio2 | radio3 |
-----------------------------

All of them are sharing the same ID, say "rd".

However, I can not do it in the following:

<asp:radiobuttonlist id="rd" runat="server" autopostback="true">
<table>
<tr>
<td><asp:listitem>radio1</asp:lineitem></td>
<td><asp:listitem>radio2</asp:lineitem></td>
<td><asp:listitem>radio3</asp:lineitem></td>
</tr>
</table>
</asp:radiobuttonlist>

..Net complains:
System.Web.UI.WebControls.ListItemCollection must have items of type
'System.Web.UI.WebControls.ListItem'. 'table' is of type
'System.Web.UI.HtmlControls.HtmlTable'.

If <asp:radiobuttonlist> and its child can only be together as a
whole, means no other html tags mixed within, it's not convenience at
all.

I guess workaround would be:
- use <asp:radiobutton> for each individual w/ the same name.
- use plain HTML tags.

Thanks!
 
C

Chan

Thanks for the info.

If there is a cell (<td/>) does not need anything, that is does not
have <asp:listitem>, is it still ok?
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top