2014-12-02 63 views
0

結合我定義ListItems得到這個RadioButtonList單選按鈕列表中選擇值在ASPX

<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

回答

1

我改變了我的數據庫字段類型爲int,並添加 「的SelectedValue =」 <%#綁定( 」SpouseLocation「)%>」 我的單選按鈕列表

答案this問題幫我