Solved

Changing Visible Values

Posted on 2004-09-27
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

732 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