473,785 Members | 2,317 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process dropdown lists on client side

Hi,

I have 2 dropdown lists on an ASP.Net page, the first is a list of states of
US, the second is City list. When user selects a state, the web page does a
postback, create a DB connection and bind a dataset to city dropdown list.
This is working for me.

But I would like to do this on the client side for the following reasons:
(1) Doing this on server side takes time, the postback and connecting to DB
costs too much.
(2) Screen flickers and will not stay in the same position during postback.
Imagine this is a bit lengthy page, and the drop down lists are in the
middle of the page, user has to do some scrolliing. I don't want to use smart
navigation, it's buggy.

Please help!
Nov 19 '05 #1
1 1565
It's pretty easy if you are familiar with JavaScript.

This can be done by rendering a javascrit array in the code behind and place
that somewhere in the HTML code and then in the onload() event of the body
element loop thru the array and load the proper things in the proper
dropdownlists.. .

I have the code for it (a four dropdownboxes solution) but if you are not
familiar with javascript it's not gonna be easy to explain this. In the end
I had a 4-dimentional Javascript array to play with:)

/Lars
"Ed Chiu" <Ed****@discuss ions.microsoft. com> wrote in message
news:A3******** *************** ***********@mic rosoft.com...
Hi,

I have 2 dropdown lists on an ASP.Net page, the first is a list of states
of
US, the second is City list. When user selects a state, the web page does
a
postback, create a DB connection and bind a dataset to city dropdown list.
This is working for me.

But I would like to do this on the client side for the following reasons:
(1) Doing this on server side takes time, the postback and connecting to
DB
costs too much.
(2) Screen flickers and will not stay in the same position during
postback.
Imagine this is a bit lengthy page, and the drop down lists are in the
middle of the page, user has to do some scrolliing. I don't want to use
smart
navigation, it's buggy.

Please help!

Nov 19 '05 #2

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

Similar topics

3
589
by: Jim Mitchell | last post by:
My Goal is to have a dropdown (DL2) filled from the selectIndexChange event of a primary dropdown (DL1). These are picklists that will be selected frequently. Can someone recommend a strategy that will not require the screen to refresh every time. 1) If I use HTML dropdown lists, how do I trigger a postback? 2) Can I load XML into the viewstate and use the viewstate data somehow? 3) Should I just bite the bullet and let the screen...
32
2734
by: Continental Translations | last post by:
Can anybody help me? I am trying to create two drop down menus, where the results of the second one vary depending on what was selected in the first one. I am using MS Script Editor in MS Front Page to do this. In my first menu, I want "English" "German" and "Russian." Now if "English" is picked, I want "French" "German" and "Spanish" to appear. If "German" is picked in the first menu, I want "English" to appear" If Russian is picked...
4
1961
by: Ian Davies | last post by:
Hello I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the first i.e. the choosen item from the first filters the items in the second first dropdown menu sub no sub 1 science >>>>>>>>> if this is selected 2 maths 3 something else
2
3630
by: Chris Becker | last post by:
This is my attempt to rephrase a question I asked earlier that got no response. I suspect it was my poor/unplanned wording. Here is another attempt: I have a form with some drop down lists. I would like the user to be able to start filling in the form, then get to one of the dropdown lists (ex: Service Type) and realize that the dropdown list does not contain the entry that they need. So next to the Service Type drop down list is a...
6
21323
by: Paul | last post by:
I am trying to setup a field validator and tried using the control to validate set to a dropdown list box but did not seem to work. Is there anyway to set this up or do you need to use client side validation? Thanks -- Paul G Software engineer.
6
10697
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. Let's say you select 1 of the items, and are properly redirected. You press the back button. I have three servers providing two different functionalities: 1. After pressing the back button, the item you selected in the dropdown is still selected.
3
1457
by: DaveF | last post by:
I need to capture a selected value of the onchange dropdown and put it in a textbox??? -- Dave
5
2033
by: John Grandy | last post by:
I wrote a function to populate my dropdowns on the client-side. The function adds <optionelements to the <selectonly if none are initially present. I call the population function from either the onfocus or onclick event of the <selectas follows : onclick="populateDropdown(this);return true;"
1
1886
by: AB | last post by:
I am creating a ASP.Net 1.1 (VB) web. I have 2 drop down lists which are independent of each other. Both are filled from a database on the pageload. There is also a search button which searches the database based on the 2 drop down list entries. The first entry in each drop down list is "Please Select". What I am trying to do via client side script is to reset the unselected drop down list when the other drop down list selects a new...
0
9480
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
10315
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
10085
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
9947
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
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
6737
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
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4045
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 we have to send another system
3
2877
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.