Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

C# code:

    protected void DropDownListDB_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (DropDownListDB.SelectedValue == "Other")
        {
            LabelIfOtherDb.Visible = true;
            TextBoxIfOtherDb.Visible = true;
        }
    }

ASP code:

                <asp:DropDownList AutoPostBack="True" ID="DropDownListDB" runat="server" Height="20px" 
                    Width="158px">
                    <asp:ListItem>- Select -</asp:ListItem>
                    <asp:ListItem>Oracle</asp:ListItem>
                    <asp:ListItem>MS SQL Server</asp:ListItem>
                    <asp:ListItem>MySQL</asp:ListItem>
                    <asp:ListItem>MS Access</asp:ListItem>
                    <asp:ListItem>Other</asp:ListItem>
                </asp:DropDownList>

I have AutoPostBack="True" but still it doesn't show my hidden textbox/label.. Any suggestions?

share|improve this question
add comment

1 Answer 1

<asp:DropDownList AutoPostBack="True" ID="DropDownListDB" OnSelectedIndexChanged="DropDownListDB_SelectedIndexChanged" runat="server" Height="20px" 
                    Width="158px">
                    <asp:ListItem>- Select -</asp:ListItem>
                    <asp:ListItem>Oracle</asp:ListItem>
                    <asp:ListItem>MS SQL Server</asp:ListItem>
                    <asp:ListItem>MySQL</asp:ListItem>
                    <asp:ListItem>MS Access</asp:ListItem>
                    <asp:ListItem>Other</asp:ListItem>
                </asp:DropDownList>
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.