Connecting Tech Pros Worldwide Forums | Help | Site Map

USING XML TO FILL LINKED DROPDOWN LIST

Jim Mitchell
Guest
 
Posts: n/a
#1: Jul 19 '05
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.



Oleg Tkachenko
Guest
 
Posts: n/a
#2: Jul 19 '05

re: USING XML TO FILL LINKED DROPDOWN LIST


Jim Mitchell wrote:
[color=blue]
> 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.[/color]
Client side DHTML scripting with XML islands?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Russell Jones
Guest
 
Posts: n/a
#3: Jul 19 '05

re: USING XML TO FILL LINKED DROPDOWN LIST


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.

"Jim Mitchell" <jim_mitchell@mindspring.com> wrote in message
news:ekr4WJxZDHA.2632@TK2MSFTNGP12.phx.gbl...[color=blue]
> My Goal is to have a dropdown (DL2) filled from the selectIndexChange[/color]
event[color=blue]
> 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[/color]
refresh[color=blue]
> 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[/color]
make[color=blue]
> it more efficient?
>
> Thanks in advance.
>
>[/color]


Jim Mitchell
Guest
 
Posts: n/a
#4: Jul 19 '05

re: USING XML TO FILL LINKED DROPDOWN LIST


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


"Russell Jones" <arj1@nospam.northstate.net> wrote in message
news:u8FSNhyZDHA.2620@TK2MSFTNGP09.phx.gbl...[color=blue]
> You can use either client-side code that reads an included XML file (see[/color]
the[color=blue]
> <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.
>
> "Jim Mitchell" <jim_mitchell@mindspring.com> wrote in message
> news:ekr4WJxZDHA.2632@TK2MSFTNGP12.phx.gbl...[color=green]
> > My Goal is to have a dropdown (DL2) filled from the selectIndexChange[/color]
> event[color=green]
> > 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[/color]
> refresh[color=green]
> > 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[/color]
> make[color=green]
> > it more efficient?
> >
> > Thanks in advance.
> >
> >[/color]
>
>[/color]


Closed Thread