473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A Beginner question DropDown list box

Hi Folks,
I have a form with two Dropdown list boxes, which get loaded with data from
Database.

DropDownList1 gets data from Table1
and
DropDownList2 gets data from Table2

Table1 has a parent child relationship with Table2 ( has a foreign key to
Table1)

DropdrownList2 needs to be loaded with the data depending up on the
selection in the 1st DropDown.

Can you guys please tell me what is the best way to implement it.

In coldFusion I did this way back by creating Data Arrays with the data in
Table1 and Table2 andimplemented the rest with ClientSide java script
loading data in the second Dropdown...
I think you guys got the picture :).

Tell me a couple of ways of doing it please. I could not find a way to
create client side Array with .NET.

Thanks in Advance,
a .NET beginner
Nov 18 '05 #1
4 1780
Somewhat simply put... the way I know how to do it

Populate DropDownList1 with data from Table1
Listen for selection event on DropDownList1
In handling event Populate DropDownList2 with info from Table2
Listen for selection event on DropDownList2
Do whatever you want next...

This way requires that when the dropdownlist value is changed that it
submits a form (POST) and then runs the selection event... something like
that.

Bryan
"anonymous" <an*******@msn.com> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
Hi Folks,
I have a form with two Dropdown list boxes, which get loaded with data from Database.

DropDownList1 gets data from Table1
and
DropDownList2 gets data from Table2

Table1 has a parent child relationship with Table2 ( has a foreign key to
Table1)

DropdrownList2 needs to be loaded with the data depending up on the
selection in the 1st DropDown.

Can you guys please tell me what is the best way to implement it.

In coldFusion I did this way back by creating Data Arrays with the data in
Table1 and Table2 andimplemented the rest with ClientSide java script
loading data in the second Dropdown...
I think you guys got the picture :).

Tell me a couple of ways of doing it please. I could not find a way to
create client side Array with .NET.

Thanks in Advance,
a .NET beginner

Nov 18 '05 #2
Thanks Bryan,
If I write an event to post back on List1 Select then it could be expensive
one and going back and forth on a lower Bandwidth might not be a good idea.
I know transfer a whole lot of data makes similar problems but looks like
that is better evil.

any other ideas?
"Bryan Masephol" <ma******@uwec.edu> wrote in message
news:OD**************@TK2MSFTNGP11.phx.gbl...
Somewhat simply put... the way I know how to do it

Populate DropDownList1 with data from Table1
Listen for selection event on DropDownList1
In handling event Populate DropDownList2 with info from Table2
Listen for selection event on DropDownList2
Do whatever you want next...

This way requires that when the dropdownlist value is changed that it
submits a form (POST) and then runs the selection event... something like
that.

Bryan
"anonymous" <an*******@msn.com> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
Hi Folks,
I have a form with two Dropdown list boxes, which get loaded with data

from
Database.

DropDownList1 gets data from Table1
and
DropDownList2 gets data from Table2

Table1 has a parent child relationship with Table2 ( has a foreign key to Table1)

DropdrownList2 needs to be loaded with the data depending up on the
selection in the 1st DropDown.

Can you guys please tell me what is the best way to implement it.

In coldFusion I did this way back by creating Data Arrays with the data in Table1 and Table2 andimplemented the rest with ClientSide java script
loading data in the second Dropdown...
I think you guys got the picture :).

Tell me a couple of ways of doing it please. I could not find a way to
create client side Array with .NET.

Thanks in Advance,
a .NET beginner


Nov 18 '05 #3
I don't know if I don't see some things, but I certainly
cannot find the "too much data" coming in due to the
postback.

Make sure you put most of the code in the PAGE_LOAD
function within the if (!IsPostBack) { } block. And the
code you write for the LIST1 selection-change will be
only retrieving values for the LIST2 (which is
inevitable). So where are the extra bytes coming in?

If you want to avoid the postback (the annoying screen-
flashing), you will have to download all the records
possible for LIST2 and then use javascript to filter the
second LIST depending on the selection in the first LIST.
I do NOT recommend this method, of course unless you are
talking about a maximum of 10 or 15 items.

-----Original Message-----
Thanks Bryan,
If I write an event to post back on List1 Select then it could be expensiveone and going back and forth on a lower Bandwidth might not be a good idea.I know transfer a whole lot of data makes similar problems but looks likethat is better evil.

any other ideas?
"Bryan Masephol" <ma******@uwec.edu> wrote in message
news:OD**************@TK2MSFTNGP11.phx.gbl...
Somewhat simply put... the way I know how to do it

Populate DropDownList1 with data from Table1
Listen for selection event on DropDownList1
In handling event Populate DropDownList2 with info from Table2
Listen for selection event on DropDownList2
Do whatever you want next...

This way requires that when the dropdownlist value is changed that it submits a form (POST) and then runs the selection event... something like that.

Bryan
"anonymous" <an*******@msn.com> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
> Hi Folks,
> I have a form with two Dropdown list boxes, which get loaded with data
from
> Database.
>
> DropDownList1 gets data from Table1
> and
> DropDownList2 gets data from Table2
>
> Table1 has a parent child relationship with Table2 (
has a foreign keyto > Table1)
>
> DropdrownList2 needs to be loaded with the data
depending up on the > selection in the 1st DropDown.
>
> Can you guys please tell me what is the best way to implement it. >
> In coldFusion I did this way back by creating Data Arrays with the data
in > Table1 and Table2 andimplemented the rest with

ClientSide java script > loading data in the second Dropdown...
> I think you guys got the picture :).
>
> Tell me a couple of ways of doing it please. I could not find a way to > create client side Array with .NET.
>
> Thanks in Advance,
> a .NET beginner
>
>


.

Nov 18 '05 #4
Thanks Michelle,
How could I achieve the second one.I do not like Flashing windows in
response to selection of an item.
I agree the data transfer is very little but the same data transferred for
more than once takes multiple of the initial load time.

I used to use <%....%> in asp to achieve the forbidden method( :) just
kidding) of client side scripting. The Script tags were used to create a
data array with Database data relevent to the page.

Could anyone please tell me the relevent one here.

Thanks

"Michelle Stone" <mi********@yahoo.com> wrote in message
news:06****************************@phx.gbl...
I don't know if I don't see some things, but I certainly
cannot find the "too much data" coming in due to the
postback.

Make sure you put most of the code in the PAGE_LOAD
function within the if (!IsPostBack) { } block. And the
code you write for the LIST1 selection-change will be
only retrieving values for the LIST2 (which is
inevitable). So where are the extra bytes coming in?

If you want to avoid the postback (the annoying screen-
flashing), you will have to download all the records
possible for LIST2 and then use javascript to filter the
second LIST depending on the selection in the first LIST.
I do NOT recommend this method, of course unless you are
talking about a maximum of 10 or 15 items.

-----Original Message-----
Thanks Bryan,
If I write an event to post back on List1 Select then it

could be expensive
one and going back and forth on a lower Bandwidth might

not be a good idea.
I know transfer a whole lot of data makes similar

problems but looks like
that is better evil.

any other ideas?
"Bryan Masephol" <ma******@uwec.edu> wrote in message
news:OD**************@TK2MSFTNGP11.phx.gbl...
Somewhat simply put... the way I know how to do it

Populate DropDownList1 with data from Table1
Listen for selection event on DropDownList1
In handling event Populate DropDownList2 with info from Table2 Listen for selection event on DropDownList2
Do whatever you want next...

This way requires that when the dropdownlist value is changed that it submits a form (POST) and then runs the selection event... something like that.

Bryan
"anonymous" <an*******@msn.com> wrote in message
news:u4**************@TK2MSFTNGP11.phx.gbl...
> Hi Folks,
> I have a form with two Dropdown list boxes, which get loaded with data from
> Database.
>
> DropDownList1 gets data from Table1
> and
> DropDownList2 gets data from Table2
>
> Table1 has a parent child relationship with Table2 ( has a foreign key
to
> Table1)
>
> DropdrownList2 needs to be loaded with the data

depending up on the > selection in the 1st DropDown.
>
> Can you guys please tell me what is the best way to implement it. >
> In coldFusion I did this way back by creating Data Arrays with the data
in
> Table1 and Table2 andimplemented the rest with

ClientSide java script > loading data in the second Dropdown...
> I think you guys got the picture :).
>
> Tell me a couple of ways of doing it please. I could not find a way to > create client side Array with .NET.
>
> Thanks in Advance,
> a .NET beginner
>
>

.

Nov 18 '05 #5

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

Similar topics

1
8254
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
2
4531
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
5
11868
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
3
3504
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
0
1178
by: alexejpevzner | last post by:
Hi, I'd like to ask for help about Access, ASP - all this is new for me... I'd like to make an Access based website for searching, comparing and adding some electrical appliances. These...
2
1224
by: Jack | last post by:
Hi there, I'm a very experienced C++ developer but a relative newcomer to web development and a raw neophyte in the ASP.NET arena. I have a very simple scenario that hopefully someone can help...
3
2786
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of...
5
6640
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
2
1156
by: =?Utf-8?B?UGF1bA==?= | last post by:
Just wondering if anyone knows if this is possible with a gridview but I have a template column with two dropdown list boxes in it and when the user makes a selection in the first box I want to run...
0
7093
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...
0
7357
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
7012
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
7468
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
5598
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
5023
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
4690
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
3180
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
3171
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.