2011-07-22 5 views
3

私の問題は、私は私がC#RadioButtonListのAsp.net

RadioButtonList ID="rbtnlistProgramPlans" runat="server" 
     asp:ListItem Text="Practical Monthly Plan" Value="0" **Monthly** asp:ListItem 
      asp:ListItem Text="Practical 3 Month's Plan" Value="1" **3 Month's** asp:ListItem 

月間でコードを必要とする私を助けてくださいWebフォームで月間と3 Month's Planを表示する必要が私の要件ごとに、データベース内の実用的​​な月次計画を保存したいですそしてそれは私が新しいasp.net午前 を私を助けるように... 3月のは、ユーザーのためのWebフォームに表示されているが、私はそのテキスト=「実践月間プラン」を選択されたRadioButtonListの保存したい

答えて

1

RadioButtonListの中にあなたの現在のListItemは

です
<asp:ListItem Text="Practical Monthly Plan" Value="0">Monthly</asp:ListItem> 

が、それはのようにする必要があります... <asp:ListItem> and </asp:ListItem>を開始する間のテキストは、テキストとoverride Text property of listitem

1

コードの元の表示として考えるよう

<asp:ListItem Text="Practical Monthly Plan" Value="0"></asp:ListItem> 

<asp:RadioButtonList id=RadioButtonList1 runat="server"> 
     <asp:ListItem Text="Practical Monthly Plan" Value="1"></asp:ListItem> 
     <asp:ListItem Text="Practical 3 Monthly Plan" Value="3"></asp:ListItem> 
     <asp:ListItem Text="Practical X Monthly Plan" Value="X"></asp:ListItem> 
</asp:RadioButtonList> 

more info from Microsoft

関連する問題