For Programmers: Free Programming Magazines  


Home > Archive > ASP .NET > March 2007 > Populating DropDownLists with AJAX - Beginner









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Populating DropDownLists with AJAX - Beginner
47computers@gmail.com

2007-03-31, 7:05 pm

I have a couple of DropDownLists in a DetailsView control (your
classic country/state lists) and I need one to be populated based on
the current selection of the other. Currently this works fine with a
postback, but an AJAX solution would be a better way of doing things.

I've been googling around for some examples and tutorials, but so far
nothing is working. I'm really a beginner with AJAX and need a simple
example or tutorial for doing specifically what I'm trying to do. I
figure it's a common enough task that there should be something out
there, but googling terms like "asp .net ajax dropdownlist" or a
similar query returns about half the internet.

Can anyone point me in the right direction, or offer some sample code
that does this seemingly simple task? I'd really appreciate it,
thanks.


Regards,
David

Ben Rush

2007-03-31, 7:05 pm

Hello,

I can certainly give you examples to do databinding, but you may be able to
accomplish the same task by simply putting the drop downlist within an
UpdatePanel and refreshing that panel when someone makes a selection.

See this:
http://ajax.asp.net/docs/mref/ M_Sy...1_62fe17e7.aspx

--
~~~~~~~~~~~
Ben Rush
http://www.ben-rush.net/blog


<47computers@gmail.com> wrote in message
news:1175358936.242964.299990@l77g2000hsb.googlegroups.com...
>I have a couple of DropDownLists in a DetailsView control (your
> classic country/state lists) and I need one to be populated based on
> the current selection of the other. Currently this works fine with a
> postback, but an AJAX solution would be a better way of doing things.
>
> I've been googling around for some examples and tutorials, but so far
> nothing is working. I'm really a beginner with AJAX and need a simple
> example or tutorial for doing specifically what I'm trying to do. I
> figure it's a common enough task that there should be something out
> there, but googling terms like "asp .net ajax dropdownlist" or a
> similar query returns about half the internet.
>
> Can anyone point me in the right direction, or offer some sample code
> that does this seemingly simple task? I'd really appreciate it,
> thanks.
>
>
> Regards,
> David
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com