How to repopulate a dropdown list without posting back?

T

TaeHo Yoo

I have two dropdown list(ie State and Region) that are populated with
data from database.
I want to repopulate the second dropdown list(Region) according to what
state user has selected without posting back to the server.

How do I implement this?

Thanks a lot in advance.
 
N

Natty Gur

Hi,

You should get all the data to the client (you can use XML islands[1])
and then use java script and the DHTML objects[2] to clear the list and
add new items to the list[3] or just change the inner html.

[1] -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk3
0/htm/xmconxmldataislands.asp
[2] -
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
/reference/objects.asp
[3] -
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml
/reference/objects.asp

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
N

Natty Gur

Cut and paste the two parts of the URL to the explorer.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
 
B

Brock

The URLs are wrapped on the lines. Make sure you get the whole address. They
work fine.
 
R

Ram

You can do it in this way.

1. Put all your functionality for getiing the data of your second drop
down in an ASPX page, and return the results as a XML content.
2.Create an XML DOM object on the client side and load the aspx page
into that object. You can also pass the query string.
Ex: xmlDocObj.load("yourpage.aspx?querystring=value);
3. Now you have all the data for the second drop down in the xml
object on the client side.
4. Parse through the XML object and populate the drop down.

Thanks
Ram Pabbaraju
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top