Groups | Blog | Home
all groups > asp.net caching > august 2003 >

asp.net caching : USING XML TO FILL LINKED DROPDOWN LIST


Jim Mitchell
8/20/2003 7:56:36 AM
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 refresh? How can I make
it more efficient?

Thanks in advance.

Russell Jones
8/20/2003 10:35:21 AM
You can use either client-side code that reads an included XML file (see the
<xml> tag for more info) or a Web service to accomplish this without
refreshing the screen. For the first method, create an MSXML document and
use XPath to extract the cotents of the picklist based on the user's
selection in the main list. For the second, use the XMLHTTP control or
remote scripting to obtain the data from the server and populate the pick
list. If you have only IE clients, you can use the Web services toolkit to
simplify parsing the Web service return value; otherwise, you'll have to
parse the returned data yourself (not a big deal).

If the pick lists are small and there aren't too many of them, you can
pre-build all of them on the server and simply hide and show them on the
client based on the user's selection in the main list, again using
client-side code.

[quoted text, click to view]

Jim Mitchell
8/20/2003 10:48:15 AM
Thanks - It sounds like client side code makes the most sense. I guess in
some cases, there is no way to write an efficient app with all server
controls. This might be a good example.

CAN YOU TELL ME HOW TO INITIATE A POSTBACK FROM A CLIENT EVENT? I can
always call the whole page again, but is there a way to tell the server this
is a postback from javascript?

Thanks again.

Jim


[quoted text, click to view]

Oleg Tkachenko
8/20/2003 5:30:38 PM
[quoted text, click to view]
Client side DHTML scripting with XML islands?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel
AddThis Social Bookmark Button