Update panel not working, Not sure why

Go To StackoverFlow.com


I would like to turn off the dropdown PhoneHelp if phone is selected in the first dropdown box, but it doesn't seem to be working. Here is the code:


        <asp:DropDownList ID="ddlHowRec" runat="server">
            <asp:ListItem Value="" Text="Choose an option"></asp:ListItem>
            <asp:ListItem Value="mail" Text="Mail"></asp:ListItem>
            <asp:ListItem Value="e-mail" Text="E-mail"></asp:ListItem>
            <asp:ListItem Value="phone" Text="Call back"></asp:ListItem>

            <asp:Label ID="lblPhoneHelp" runat="server" AssociatedControlID="ddlPhoneHelp"></asp:Label>
        <asp:DropDownList ID="ddlPhoneHelp" runat="server">
            <asp:ListItem Value="" Text="Choose an option"></asp:ListItem>
            <asp:ListItem Value="yes" Text="Yes"></asp:ListItem>
            <asp:ListItem Value="no" Text="No"></asp:ListItem>


    Protected Sub ddlHowRec_SelectedIndexChanged(ByVal sender As Object, ByVal e As      System.EventArgs) Handles ddlHowRec.SelectedIndexChanged

    If ddlHowRec.SelectedValue = "phone" Then
        lblPhoneHelp.Enabled = False
        lblPhoneHelp.Enabled = True
    End If
 End Sub

Thank you

2012-04-04 19:36
by Michelle


You are disabling lblPhoneHelp instead of ddlPhoneHelp.

ddlPhoneHelp.Enabled = Not ddlHowRec.SelectedValue = "phone"
2012-04-04 19:38
by Rango