473,663 Members | 2,877 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

visible or not visible

I am using the following code to make a textbox visible if a certain item is
selected from the dropdownlist box. On debug it appears to not even fire the
selected index change module. What is wrong

Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ddlMedicalNeces sity.SelectedIn dexChanged
If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
txtSpecify.Visi ble = True
Else
txtSpecify.Visi ble = False
End If
End Sub

I want the textbox to appear only if other (please specify): is selected. I
have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
variable and then put the variable in if phrase but that does not work
either. Thank you.
Aug 30 '06 #1
3 1555
Chances are the event is not configured in the HTML. There are two ways to
possibly fix this:

1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
doesn't work, see #2.

2) Change the access for the method from Private to Publc. Click on the HTML
tab, and find where the dropdownlist is declared. It should look like:
<asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
<asp:DropDownLi st id="DropDownLis t1"
OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
runat="server"> </asp:DropDownLis t>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajee sh" wrote:
I am using the following code to make a textbox visible if a certain item is
selected from the dropdownlist box. On debug it appears to not even fire the
selected index change module. What is wrong

Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ddlMedicalNeces sity.SelectedIn dexChanged
If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
txtSpecify.Visi ble = True
Else
txtSpecify.Visi ble = False
End If
End Sub

I want the textbox to appear only if other (please specify): is selected. I
have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
variable and then put the variable in if phrase but that does not work
either. Thank you.
Aug 30 '06 #2
Shouldn't txSpecify.Refre sh be done after changing the value.
UsualDosage wrote:
Chances are the event is not configured in the HTML. There are two ways to
possibly fix this:

1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
doesn't work, see #2.

2) Change the access for the method from Private to Publc. Click on the HTML
tab, and find where the dropdownlist is declared. It should look like:
<asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
<asp:DropDownLi st id="DropDownLis t1"
OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
runat="server"> </asp:DropDownLis t>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajee sh" wrote:
I am using the following code to make a textbox visible if a certain item is
selected from the dropdownlist box. On debug it appears to not even fire the
selected index change module. What is wrong

Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ddlMedicalNeces sity.SelectedIn dexChanged
If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
txtSpecify.Visi ble = True
Else
txtSpecify.Visi ble = False
End If
End Sub

I want the textbox to appear only if other (please specify): is selected. I
have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
variable and then put the variable in if phrase but that does not work
either. Thank you.
Aug 30 '06 #3
#1 did the trick thank you

"UsualDosag e" wrote:
Chances are the event is not configured in the HTML. There are two ways to
possibly fix this:

1) Ensure the "AutoPostBa ck" property is set to TRUE. If it is, and still
doesn't work, see #2.

2) Change the access for the method from Private to Publc. Click on the HTML
tab, and find where the dropdownlist is declared. It should look like:
<asp:DropDownLi st id="DropDownLis t1" runat="server"> </asp:DropDownLis t>. You
will need to add the "OnSelectIndexC hanged" event handler. Make it look like:
<asp:DropDownLi st id="DropDownLis t1"
OnSelectIndexCh anged="ddlMedic alNecessity_Sel ectedIndexChang ed"
runat="server"> </asp:DropDownLis t>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajee sh" wrote:
I am using the following code to make a textbox visible if a certain item is
selected from the dropdownlist box. On debug it appears to not even fire the
selected index change module. What is wrong

Private Sub ddlMedicalNeces sity_SelectedIn dexChanged(ByVa l sender As
System.Object, ByVal e As System.EventArg s) Handles
ddlMedicalNeces sity.SelectedIn dexChanged
If ddlMedicalNeces sity.SelectedVa lue = "Other (please specify):" Then
txtSpecify.Visi ble = True
Else
txtSpecify.Visi ble = False
End If
End Sub

I want the textbox to appear only if other (please specify): is selected. I
have tried taking the value of ddlmedicalneces sity.selectedva lue and put in a
variable and then put the variable in if phrase but that does not work
either. Thank you.
Aug 30 '06 #4

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

Similar topics

0
1388
by: Eric J Owens | last post by:
Thanks and Hello to you! I have a form in A2k that has a tab control on it. The form opens the first page and filters the records I want just fine. When I click a tab, to view another set of records (different filter), the filter does not work. At the same time, I am trying to set certain fields as visible or invisible depending on the tab, and having problems with that as well. It seems that after initially setting the filter, the...
5
5546
by: Lyn | last post by:
Hi, I have a form which contains a number of subforms in different pages of a tab control. In the detail section of each subform, I list records related to the main form record, but from different tables. In the footer section of the subform I have a Notes text box and three buttons (Add, Update, Delete). The latter each open a separate form for updating or deleting the subform data (the records cannot be updated or deleted directly...
16
11547
by: Miguel Dias Moura | last post by:
Hello, i have 5 panels in an ASP.net / VB page. The panel 1 is visible the other 4 are NOT visible. I also have 5 images: image 1, image 2, ..., image5. When i click one of the images, image N, the panel N becomes visible and all the other invisible.
15
3030
by: Mephisto187 | last post by:
How can I find the currently visible desktop? By calling EnumWindowStations and EnumDesktops I get a list of all available desktops. But is there a way to figure out which one of them is currently visible? I've tried to find the visible desktop by comparing the desktop handle, returned by the OpenDesktop function, to the desktop handle received by calling OpenInputDesktop. The result is that the default desktop is always the one...
3
3721
by: =?Utf-8?B?RnJlZHJpaw==?= | last post by:
Hi I have a problem in one of my user controls that I cannot find any solution for. I'am running C# for Visual studio 2003 and developing a windows application. The problem is the following: I have a user control with several panels inside it. Each panel is docked at top, which means that if one panel is hidden, the panels underneath it will move up to cover the newly hidden area (basic information, I know, but just to clarify :-). Forms...
0
8436
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
8345
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
8858
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...
1
8548
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
7371
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...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
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
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.