How to repopulate a dropdown list without posting back?

  • Thread starter Thread starter TaeHo Yoo
  • Start date Start date
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.
 
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
 
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
 
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
 
Back
Top