开发者

asp.net Radiobutton list Descriptive text

This is my code

<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>

My problem is i want to store ListItem Text into database.if the user clicks on radio button the corresponding di开发者_StackOverflow社区scriptive should store Please help me guys


On the ASPX page, add this code to your radiobuttonlist:

AutoPostBack = "true" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged

On the code behind, just hook up that event (the event is generated if you just double click on your radiobuttonlist


From what I understand of your question, you need the SelectedItem.Text

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜