Radiobutton文本内联

时间:2013-07-09 14:24:12

标签: asp.net radiobuttonlist

我正在尝试在我的页面上设置Yes / No RadioButtonList,如下所示:

  

[=]是[=]否

目前,我的.skin文件中的代码如下所示:

<asp:RadioButtonList runat="server" RepeatDirection="Horizontal" RepeatColumns="2"></asp:RadioButtonList>

RBL的渲染方式如下:

  

[=] [=]
     是否

我没有为它写任何CSS,所以这就是列表演示中的所有内容。

为清楚起见,我想在各自的单选按钮旁边输入是/否文本。任何人都可以向我解释他们为什么不这样做以及如何做到这一点?

1 个答案:

答案 0 :(得分:1)

我没有突然面对这个问题。但是我向RadioButtonList提到了一些少量的宽度(50px)然后它被复制了。只需将RadioButtonList的宽度增加一些量即可。它将按您的要求呈现。

在我的情况下,我给了Width="95px"如下

    <asp:RadioButtonList Width="95px" ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal" RepeatColumns="2">
        <asp:ListItem Text="Yes"></asp:ListItem>
        <asp:ListItem Text="No"></asp:ListItem>
    </asp:RadioButtonList>

输出

enter image description here