【问题标题】:RadioButtonList selected value binding in aspx在 aspx 中的 RadioButtonList 选定值绑定
【发布时间】:2014-12-02 23:35:04
【问题描述】:

我得到了这个RadioButtonList 并定义了ListItems

<asp:RadioButtonList ID="RblSpouseLocation" runat="server" RepeatDirection="Horizontal">
        <asp:ListItem Text="In Country" Value="0"></asp:ListItem>
        <asp:ListItem Text="Outside of Country" Value="1"></asp:ListItem>
  </asp:RadioButtonList>

我的数据库中有一个bit 类型的字段“SpouseLocation”。我需要将RadioButtonList 的选定值绑定到该字段。

我在代码隐藏中找到了如何做到这一点的教程,但可以在aspx 中完成吗?

【问题讨论】:

    标签: asp.net radiobuttonlist


    【解决方案1】:

    我将我的数据库字段类型更改为 int 并将 "SelectedValue='" 添加到我的单选按钮列表中

    this问题的答案帮助了我

    【讨论】:

      猜你喜欢
      • 2015-03-11
      • 2013-02-18
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 2013-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多