Link to home
Start Free TrialLog in
Avatar of DoughBoy
DoughBoy

asked on

Changing Visible Values

Hi All,
Using VB.NET

On the ASPX page, I have a simple set of web controls:
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:CheckBox id="CheckBox1" style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP: 48px"
runat="server"></asp:CheckBox>

<asp:DropDownList id="DropDownList1" style="Z-INDEX: 102; LEFT: 112px; POSITION: absolute; TOP: 136px" runat="server" Visible="False"></asp:DropDownList>

<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 104px; POSITION: absolute; TOP: 168px"
runat="server" Visible="False"></asp:TextBox>

</form>
</body>

On the server side click event of the checkbox, i want to make the other two controls invisible. However, the code is being ignored. I have tried changing the logic of "if-statements" but nothing works. What am I doing wrong?

Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged

        If CheckBox1.Checked = False Then
            DropDownList1.Visible = False
            TextBox1.Visible = False
        Else
            DropDownList1.Visible = True
            TextBox1.Visible = True
        End If

    End Sub

Thanks
DoughBoy
ASKER CERTIFIED SOLUTION
Avatar of GrumbleBot
GrumbleBot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DoughBoy
DoughBoy

ASKER

That's it. Thanks!