Drop Down Extender

Source Code :


<form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
      
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:DropDownExtender ID="TextBox1_DropDownExtender" runat="server"
        DynamicServicePath="" Enabled="True"  DropDownControlID="Panel1" TargetControlID="TextBox1"
        HighlightBackColor="Orange"
            DropArrowBackColor="OrangeRed">
    </asp:DropDownExtender>
    <asp:Label ID="lbl1" runat="server"></asp:Label>
    <asp:Panel
            ID="Panel1"
            runat="server"
            BorderColor="Pink"
            BorderWidth="2"
            >
            <asp:RadioButtonList
                ID="RadioButtonList1"
                runat="server"
                OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged"
                AutoPostBack="true"
                >
                <asp:ListItem>Crimson</asp:ListItem>
                <asp:ListItem>Orange</asp:ListItem>
                <asp:ListItem>HotPink</asp:ListItem>
                <asp:ListItem>DarkRed</asp:ListItem>
            </asp:RadioButtonList>
        </asp:Panel>

    
    </form>



Code Behind:


  protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        TextBox1.Text = RadioButtonList1.SelectedItem.Text;
    }



In the above code on clicking on textbox you will get  radio list after selecting the value the selected value would be displayed in the textbox

Ebook Download
View all
Learn
View all