Solved

Changing Visible Values

Posted on 2004-09-27
2
163 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now