473,508 Members | 2,355 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 ddlMedicalNecessity_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ddlMedicalNecessity.SelectedIndexChanged
If ddlMedicalNecessity.SelectedValue = "Other (please specify):" Then
txtSpecify.Visible = True
Else
txtSpecify.Visible = 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 ddlmedicalnecessity.selectedvalue 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 1551
Chances are the event is not configured in the HTML. There are two ways to
possibly fix this:

1) Ensure the "AutoPostBack" 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:DropDownList id="DropDownList1" runat="server"></asp:DropDownList>. You
will need to add the "OnSelectIndexChanged" event handler. Make it look like:
<asp:DropDownList id="DropDownList1"
OnSelectIndexChanged="ddlMedicalNecessity_Selected IndexChanged"
runat="server"></asp:DropDownList>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajeesh" 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 ddlMedicalNecessity_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ddlMedicalNecessity.SelectedIndexChanged
If ddlMedicalNecessity.SelectedValue = "Other (please specify):" Then
txtSpecify.Visible = True
Else
txtSpecify.Visible = 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 ddlmedicalnecessity.selectedvalue 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.Refresh 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 "AutoPostBack" 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:DropDownList id="DropDownList1" runat="server"></asp:DropDownList>. You
will need to add the "OnSelectIndexChanged" event handler. Make it look like:
<asp:DropDownList id="DropDownList1"
OnSelectIndexChanged="ddlMedicalNecessity_Selected IndexChanged"
runat="server"></asp:DropDownList>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajeesh" 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 ddlMedicalNecessity_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ddlMedicalNecessity.SelectedIndexChanged
If ddlMedicalNecessity.SelectedValue = "Other (please specify):" Then
txtSpecify.Visible = True
Else
txtSpecify.Visible = 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 ddlmedicalnecessity.selectedvalue 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

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

1) Ensure the "AutoPostBack" 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:DropDownList id="DropDownList1" runat="server"></asp:DropDownList>. You
will need to add the "OnSelectIndexChanged" event handler. Make it look like:
<asp:DropDownList id="DropDownList1"
OnSelectIndexChanged="ddlMedicalNecessity_Selected IndexChanged"
runat="server"></asp:DropDownList>

Recompile and run, and it should work for you.
--
"Quae narravi, nullo modo negabo."
"bindurajeesh" 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 ddlMedicalNecessity_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ddlMedicalNecessity.SelectedIndexChanged
If ddlMedicalNecessity.SelectedValue = "Other (please specify):" Then
txtSpecify.Visible = True
Else
txtSpecify.Visible = 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 ddlmedicalnecessity.selectedvalue 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
1383
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...
5
5533
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...
16
11497
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,...
15
3002
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...
3
3717
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...
0
7224
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,...
0
7379
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...
1
7038
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...
0
7493
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5625
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,...
1
5049
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...
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.