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:Check Box>
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 102; LEFT: 112px; POSITION: absolute; TOP: 136px" runat="server" Visible="False"></asp:Drop DownList>
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 104px; POSITION: absolute; TOP: 168px"
runat="server" Visible="False"></asp:Text Box>
</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(B yVal 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
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:Check
<asp:DropDownList id="DropDownList1" style="Z-INDEX: 102; LEFT: 112px; POSITION: absolute; TOP: 136px" runat="server" Visible="False"></asp:Drop
<asp:TextBox id="TextBox1" style="Z-INDEX: 103; LEFT: 104px; POSITION: absolute; TOP: 168px"
runat="server" Visible="False"></asp:Text
</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(B
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER