Asp.net 单选按钮文本行

Asp.net 单选按钮文本行,asp.net,radiobuttonlist,Asp.net,Radiobuttonlist,我正在尝试在我的页面上设置“是/否”RadioButton列表,呈现如下: [=]是[=]否 目前,我的.skin文件中的代码如下所示: <asp:RadioButtonList runat="server" RepeatDirection="Horizontal" RepeatColumns="2"></asp:RadioButtonList> RBL的渲染方式如下所示: <asp:RadioButtonList runat="server" RepeatD

我正在尝试在我的页面上设置“是/否”RadioButton列表,呈现如下:

[=]是[=]否

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

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

RBL的渲染方式如下所示:

<asp:RadioButtonList runat="server" RepeatDirection="Horizontal" RepeatColumns="2"></asp:RadioButtonList>
[=][=]
是不是

我还没有为它编写任何CSS,所以这就是列表演示中涉及的全部内容


为了清楚起见,我想在它们各自的单选按钮旁边显示Yes/No(是/否)文本。谁能给我解释一下他们为什么不这样做以及怎么做?

我没有突然面对这个问题。但我在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>

输出


我没有突然面对这个问题。但我在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>

输出


事实证明,在我的代码中应用了css,这破坏了它,但这仍然是一种非常有效的可能性。它显然没有解决我的问题,但我给它一个+1,我想这肯定是css宽度的问题。某些内容可能具有覆盖宽度css。尝试将内联css应用于width with!重要的。比如style=“width:100px!important”。事实证明,在我的代码中应用了css破坏了它,但这仍然是一种非常有效的可能性。它显然没有解决我的问题,但我给它一个+1,我想这肯定是css宽度的问题。某些内容可能具有覆盖宽度css。尝试将内联css应用于width with!重要的。比如style=“宽度:100px!重要”。