Process dropdown lists on client side

G

Guest

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!
 
L

Lars Netzel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top