【问题标题】:How to display no text on radiobutton but has a value c#如何在单选按钮上不显示文本但具有值c#
【发布时间】:2014-06-05 00:09:01
【问题描述】:

有谁知道在单选按钮项目中不显示任何文本但每个都有一个值?

这是我的单选按钮列表:

  <asp:RadioButtonList ID="rdoD4_1" runat="server" RepeatDirection="Horizontal" Width="407px">
                        <asp:ListItem>0</asp:ListItem>
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                        <asp:ListItem>4</asp:ListItem>
                        <asp:ListItem>5</asp:ListItem>
                        <asp:ListItem>6</asp:ListItem>
                        <asp:ListItem>7</asp:ListItem>
                    </asp:RadioButtonList>

问题是它在每个列表项旁边显示 0、1、2 等 - 我想保留值但不显示文本 - 有什么想法吗?

【问题讨论】:

    标签: c# asp.net radio-button


    【解决方案1】:

    尝试显式设置 Value 和 Text 属性。

    <asp:RadioButtonList runat="server">
        <asp:ListItem Value="1" Text="" runat="server"></asp:ListItem>
        <asp:ListItem Value="2" Text="" runat="server"></asp:ListItem>
    </asp:RadioButtonList>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-02-10
      • 1970-01-01
      • 2020-03-16
      • 2019-01-16
      • 2011-10-12
      • 1970-01-01
      相关资源
      最近更新 更多