473,503 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dropdownlistboxes

Hi

I am a vb.net 2005 newbie, I am trying to get a sample of two
dropdownlistboxes which are connected in a master detail way. Suppose I have
a company ddl then when i select a company i want the second 'employees' ddl
to be populated with only the employees of that company?

thanks for your input

Eric
Jan 16 '07 #1
2 872
Check out this sample (3 DDLs), at ASPNet101.com:
http://aspnet101.com/aspnet101/aspne...x?code=ddl3MDB

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Eric Effer" <be****@gmail.comwrote in message
news:uT**************@TK2MSFTNGP03.phx.gbl...
Hi

I am a vb.net 2005 newbie, I am trying to get a sample of two
dropdownlistboxes which are connected in a master detail way. Suppose I
have
a company ddl then when i select a company i want the second 'employees'
ddl
to be populated with only the employees of that company?

thanks for your input

Eric


Jan 16 '07 #2
Typically, you would use the SelectedIndexChanged event of the first
dropdown box to call whatever function you would want in order to populate
the second dropdown list. You also need to set the first dropdownlist's
autopostback property to true. This will cause it to fire the
selectedindexchanged event whenever a new item in the dropdownlist is
selected. Don't forget though, you'll need to ensure that you only pass a
valid value to your population funciton. In other words, if you have the
first item of dropdownlist 1 as something like "Choose an Item" with an
empty value, you'll need to check that the value isn't empty before you try
to populate dropdownlist 2.

--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Eric Effer" <be****@gmail.comwrote in message
news:uT**************@TK2MSFTNGP03.phx.gbl...
Hi

I am a vb.net 2005 newbie, I am trying to get a sample of two
dropdownlistboxes which are connected in a master detail way. Suppose I
have a company ddl then when i select a company i want the second
'employees' ddl to be populated with only the employees of that company?

thanks for your input

Eric

Jan 16 '07 #3

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

Similar topics

1
1691
by: jeyapriya | last post by:
Dear Friends This is Jeyapriya. Right now I am working in the ASP.NET with VB coding & the back end is SQL SERVER 2000. My dilemma is I have to design a form with 2 DropDownListboxes. I have...
1
1105
by: sweatha | last post by:
Dear Friends This is Sweatha. Right now I am working in the ASP.NET 2005 with VB coding & the back end is SQL SERVER 2000. My dilemma is I have to design a form with 2 DropDownListboxes. I...
3
887
by: razen12345 | last post by:
Hi! plz guide me that how can i get related information from one dropdownlistbox to another. For ex: My first Dropdownlist contains country names,second dropdownlist contains states of any...
5
3412
by: smithak82 | last post by:
I am tring to create n number of dropdown list.each have the same content. In this way i am able to create the dropdownlist but when the post back happens on the page the dropdownlist vanishes. so...
0
7201
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,...
1
6988
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
7456
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
4672
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...
0
3166
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...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1510
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
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
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.