473,657 Members | 2,598 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh controls on Panel in webform?

How do you refresh the controls on a panel?

I've got a VB webform which contains a panel. On that panel is a
checkbox and a textbox. I'd like the textbox to appear when the
checkbox is checked and disappear when the checkbox is unchecked.

My code is:

Private Sub checkBox1_Check edChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles checkBox1.Check edChanged
If checkBox1.Check ed Then
textBox1.visibl e=False
else
textBox1.visibl e=True
end if
End Sub

The CheckChanged routine is being called when I check/uncheck the
checkbox. However, The TextBox doesn't disappear. The page needs to
be refreshed, but there doesn't seem to be anything like
Panel1.Refresh( ) or textBox.Refresh ()
Nov 18 '05 #1
3 4741
Probably the checkbox control is not set to autopostback.
Or it can happen to be set on autopostback but he lost his attached event,
and you can look in properties events tag to see if the checkbox has the
event attached.

If you say that the event CheckChange is called when you check/uncheck and
your texbox doesn't dissapear try to search in your page some other possible
setting of textbox1 visibility.

And your code should be like this to see the textbox1 when your checkbox si
checked.
textBox1.visibl e = checkBox1.Check ed;

Cheers
"*no spam*" wrote:
How do you refresh the controls on a panel?

I've got a VB webform which contains a panel. On that panel is a
checkbox and a textbox. I'd like the textbox to appear when the
checkbox is checked and disappear when the checkbox is unchecked.

My code is:

Private Sub checkBox1_Check edChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles checkBox1.Check edChanged
If checkBox1.Check ed Then
textBox1.visibl e=False
else
textBox1.visibl e=True
end if
End Sub

The CheckChanged routine is being called when I check/uncheck the
checkbox. However, The TextBox doesn't disappear. The page needs to
be refreshed, but there doesn't seem to be anything like
Panel1.Refresh( ) or textBox.Refresh ()

Nov 18 '05 #2
NoSpam,

I made a panel and on that a checkbox and a textbox.

With this code the textbox was not on the panel when the checkbox was
checked (I assume that you have set that autopostback as well).
\\\
Private Sub Page_Load(ByVal sender As System.Object, _
ByVal e As System.EventArg s) Handles MyBase.Load
CheckBox1.AutoP ostBack = True
End Sub
Private Sub checkBox1_Check edChanged(ByVal _
sender As System.Object, ByVal e As System.EventArg s) _
Handles CheckBox1.Check edChanged
If CheckBox1.Check ed Then
TextBox1.Visibl e = False
Else
TextBox1.Visibl e = True
End If
End Sub
///
I hope this helps?

Cor

"*no spam*" <no*****@yahoo. com>
How do you refresh the controls on a panel?

I've got a VB webform which contains a panel. On that panel is a
checkbox and a textbox. I'd like the textbox to appear when the
checkbox is checked and disappear when the checkbox is unchecked.

My code is:

Private Sub checkBox1_Check edChanged(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles checkBox1.Check edChanged
If checkBox1.Check ed Then
textBox1.visibl e=False
else
textBox1.visibl e=True
end if
End Sub

The CheckChanged routine is being called when I check/uncheck the
checkbox. However, The TextBox doesn't disappear. The page needs to
be refreshed, but there doesn't seem to be anything like
Panel1.Refresh( ) or textBox.Refresh ()

Nov 18 '05 #3
It turned out to be the autopostback setting. thx to all who replied!
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1611
by: keith | last post by:
I have a panel on my form and add controls (e.g. TextBox) into it at runtime. What I want is the controls will display on same line if they are visiable in the panel horizontally. If any of the controls outside panel, it will be displayed to next line. Is there any property I can set in the panel to do it?
0
1080
by: GeorgeKaz | last post by:
i have a very irriting problem that i have written a short piece of code to demonstrate. The problem is that my aspx page is not fully refreshed after an event is fired, which is delegated to an ImageButton during runtime. Any suggestions would be great. This code is the c# behind a webform with 1 panel and 2 buttons on it. I can see that the Page controls are correct after the event, but the page does not display it this way. ...
1
3527
by: hqdtech | last post by:
how to refresh webform from other webform I have 2 webform, i want if webform A was close then webform B wil refresh. And the problem second: how to catch packet on the network in C#. thanks
3
2478
by: George K | last post by:
Hi, i have a very irriting problem that i have written a short piece of code to demonstrate. The problem is that my aspx page is not fully refreshed after an event, which is delegated to an ImageButton during runtime, is fired. Any suggestions would be great. This code is the c# behind a webform with 1 panel and 2 buttons on it. I can see that the Page controls are correct after the event, but the page does not display it this way. ...
2
2918
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have a WebForm with some textboxes, dropdownlists, a panel, imagebutton and so on. When I click on the image button (which was created at design time) I dynamically build a table. In each of row of that new table I put several cells and one cell...
12
1442
by: Aaron | last post by:
Is there a way to get the names of all of the textboxes that are placed on a panel? I have several panels on my .NET application, each with several textbox controls. I would like to get all of the names of the textboxes and clear to text values without manually typing out all of the names. Is there an easy way to specify the panel that these controls are placed in and get those names? something like
3
2164
by: *no spam* | last post by:
How do you refresh the controls on a panel? I've got a VB webform which contains a panel. On that panel is a checkbox and a textbox. I'd like the textbox to appear when the checkbox is checked and disappear when the checkbox is unchecked. My code is: Private Sub checkBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles checkBox1.CheckedChanged
3
1524
by: Connor T | last post by:
Hi, I have a form which is dynamically generated from the contents of a Database using commands such as this: hostform.Controls.Add(aRadio) However, that adds the control to the top level window. I want to add them to a panel i've created so that can do the scrolling Any ideas?
4
4749
by: =?Utf-8?B?RHlsYW5TbWl0aA==?= | last post by:
I have a WebForm where I'm dynamically creating some controls and I'm having difficulty understanding how the state is being persisted and how to work with it. I've created a simplified example to demonstrate my issues. Lets say I have a WebForm with a DropDownList where the user selects a number from 1 to 10 (the DropDownList is not dynamically created). I also have a button on there that I use to trigger a PostBack. Based on the...
0
8425
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8326
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8845
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8743
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8522
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7355
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5647
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4333
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1973
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.