Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# asp.net单选按钮列表描述性文本_C#_.net_Asp.net_Radiobuttonlist - Fatal编程技术网

C# asp.net单选按钮列表描述性文本

C# asp.net单选按钮列表描述性文本,c#,.net,asp.net,radiobuttonlist,C#,.net,Asp.net,Radiobuttonlist,这是我的密码 <asp:RadioButtonList ID="rbtnlistProgramPlans" runat="server" Font-Names="Tahoma" Font-Size="Small" ForeColor="White" RepeatColumns="3" style="position: relative; top: -775px; left: 0px; width: 688px;" BorderS

这是我的密码

<asp:RadioButtonList ID="rbtnlistProgramPlans" runat="server" Font-Names="Tahoma" 
            Font-Size="Small" ForeColor="White" RepeatColumns="3" 
        style="position: relative; top: -775px; left: 0px; width: 688px;" 
        BorderStyle="None">
            <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>
            <asp:ListItem Text="Premium Monthly Plan" Value="2">Monthly</asp:ListItem>
            <asp:ListItem Text="Premium 3 Month's Plan" Value="3">3 Month's</asp:ListItem>
            <asp:ListItem Text="Elite Monthly Plan" Value="4">Monthly</asp:ListItem>
            <asp:ListItem Text="Elite 3 Month's Plan" Selected="True" Value="5">3 Month's</asp:ListItem>
        </asp:RadioButtonList>

我的问题是我想将ListItem文本存储到数据库中。如果用户单击单选按钮,相应的描述应该存储请帮助我在ASPX页面上,将此代码添加到RadioButton列表中:

AutoPostBack = "true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged

在“代码隐藏”中,只需连接该事件。如果双击RadioButton列表,就会生成该事件。根据我对您的问题的理解,您需要SelectedItem.Text

    rbtnlistProgramPlans.SelectedItem.Text 
  // Will return Selected Radio button list Item Text

你能解释清楚吗?请再解释一下。您希望在单击按钮或更改单选按钮本身的选择时发生这种情况吗?