Solved

Changing Visible Values

Posted on 2004-09-27
2
165 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:DoughBoy
2 Comments
 
LVL 3

Accepted Solution

by:
GrumbleBot earned 50 total points
ID: 12165002
is the AutoPostBack property set to true? if not then it doesn't get updated on the click.

Hope this helps.
Good Luck
0
 

Author Comment

by:DoughBoy
ID: 12172363
That's it. Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question