p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   ASP.NET AJAX (http://p2p.wrox.com/showthread.php?t=52610)

inkrajesh January 12th, 2007 01:21 AM


Can someone guide me how to get a Cascading Dropdown box in ASP.NET AJAX working in a web application.

The requirement is like this..there will be two Dropdownlist...one should be filled with Country. On selecting the first list the second list has to populate the cities ,which is taken from a database.

I tried the video on ASP.NET site. I tried a few other sites too...but not of much help. If someone has already done it or knows a site where i can refer I wouldbe thankful.

I have installed the framework and got some basic controls working.

Thank you


Quick209 January 12th, 2007 02:26 PM

For what you are trying to do you can either do it by hand which would encompass too much of this post writing out AJAX by hand or you can use MS AJAX (used to be Atlas).
using MS AJAX is easier and involves you installing the MS AJAX framework along with the toolkit that contains cascading dropdowns. Inside the sample site in the toolkit it shows how to use it that comes with it and you can load it up in VS.

Cut and dry, you will need to build a web service that will access the datasource that contains the data you are cascading. The service should contain the methods to return what the list should show for each condition. The videos are hard to understand and it is easier to look at the sample website as it shows you all the methods and properties for their control and you can look at the source to see how they did it.

inkrajesh January 13th, 2007 12:30 AM

Thank you Quick209 !

Yes, I am using ASP.NET AJAX...

Can't we call the function directly from a page with out using Web Services. If we are to use Cascading Dropdowns do we have to use webservices always ..? My concern is because I have not tried web services so far!!


Quick209 January 19th, 2007 03:42 PM

It will require a service and I believe they have a video sample of it on their site using it that doesn't go too entailed. The default VS builds you for the web service will do for the headers. Just need to create the method. You can use 1 web service with multiple methods for the whole thing. You don't need to register the service with the server, you just need the ASMX registered with the site through the MSAJAX script manager and then tell the cascading drop down what to do with it. I will look through some of the things I made at work and post a short example later on how to build this but it is easier than you think it is. :)

All times are GMT -4. The time now is 08:59 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.