<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4682812598133625697</atom:id><lastBuildDate>Sat, 05 Oct 2024 03:25:06 +0000</lastBuildDate><title>GeoDataSource</title><description>Geographic Data for Everyone</description><link>http://geodatasource.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4682812598133625697.post-7358998446423398478</guid><pubDate>Tue, 01 Sep 2009 09:30:00 +0000</pubDate><atom:updated>2009-09-02T00:59:57.174-07:00</atom:updated><title>Rapidly develop and deploy Country/State/City drop down lists with the World Major Cities database package</title><description>&lt;div style=&quot;font-family: arial; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;a href=&quot;http://www.geodatasource.com/world-major-cities.html?rid=207&quot; target=&quot;_blank&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 169px; height: 168px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VzlJ0vuVWbVb09RlBMMGAGxfydQSEUxfrxh-6hyZzMWE5UzOgL_tmHbo9yBobCxLd11Tv5yuIwI2pYrYkSz2e_t6-nAYbtGvkRdy3gv3YOtlEVJXnxfk4U5_0c2f5zpSZlYD0qWkfrU/s320/citiesmajor.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376401765243378402&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;We are proud to present to you the GeoDataSource World Major Cities package. All your requests and feedbacks have culminated in this one package that encompasses usability and easy of deployment for your Country/State/City drop down lists.&lt;br /&gt;&lt;br /&gt;In this package, you will find all of the countries and their states along with their major cities. By using this data, you can now easily create the Country/State/City drop down lists that you have wanted to create for so long.&lt;br /&gt;&lt;br /&gt;No more sifting through millions of cities that you will never need. To make this package easier to deploy, we have generously included sample codes in various programming languages which implements the Country/State/City drop down lists for you. All you have to do is just customize the codes a bit and you are on your way. Fast and easy deployment is what you will get when you purchase this package.&lt;br /&gt;&lt;br /&gt;Below we have included a slightly more advanced sample code which uses ASP.NET 2.0 and Microsoft AJAX to implement the Country/State/City drop down lists.&lt;br /&gt;&lt;br /&gt;Before we get started, in case any of you are not familiar with AJAX, maybe a little explanation would be in order.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is AJAX?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;AJAX stands for Asynchronous JavaScript and XML. AJAX allows web applications to retrieve data from the server asynchronously in the background without reloading the page. With a traditional web page, for the content to be refreshed, the page would have to be reloaded every time. However, by using AJAX, a web application can request only the necessary data which can then be updated on the current page without reloading or refreshing the page. AJAX brings to the web page the interactivity, richness and responsiveness of a windows application. The web server bandwidth will also be greatly reduced as only the necessary data is requested from the server.&lt;br /&gt;&lt;br /&gt;Now that you have an idea what is AJAX and what it is capable of, let’s get started.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Introduction to cascading drop down lists&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;What we will be doing are called cascading drop down lists. This because, when you select a different value in one of the drop down lists, another one will automatically reload with related values. For instance, when you select United States in the Country drop down list, the State drop down list will display all the States in the United States.&lt;br /&gt;&lt;br /&gt;If you don’t want to see the tutorial below and just want to download the codes, you just go to &lt;a href=&quot;http://www.geodatasource.com/blogfiles/CascadingDropDownListsinNetandAJAXSampleCode.zip&quot;&gt;here&lt;/a&gt;. Just make sure you fulfil the essentials first.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Essentials&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;ASP.NET 2.0 does not come with the AJAX Extensions so you will have to download and install the ASP.NET 2.0 AJAX Extensions 1.0 which you can get from &lt;a href=&quot;http://www.asp.net/ajax/downloads/archive/&quot; target=&quot;_blank&quot;&gt;http://www.asp.net/ajax/downloads/archive/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Next, download the AJAX Control Toolkit for ASP.NET 2.0 from &lt;a href=&quot;http://www.asp.net/ajax/downloads/&quot; target=&quot;_blank&quot;&gt;http://www.asp.net/ajax/downloads/&lt;/a&gt;. Extract all files from inside the zip file to a temporary folder and then locate the AjaxControlToolkit.dll file which should be in the SampleWebsite\Bin folder. You will need to copy this file to the Bin folder of your application later on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Using Visual Studio 2005 to create an AJAX-Enabled Web Application project&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now that we have done all the prerequisites, let us run Visual Studio 2005.&lt;br /&gt;&lt;br /&gt;Click on &lt;b&gt;Create Project&lt;/b&gt;. You should see the &lt;b&gt;New Project&lt;/b&gt; dialog box come up like below. In &lt;b&gt;Project types&lt;/b&gt;, select &lt;i&gt;Visual Basic&lt;/i&gt;. Under &lt;b&gt;Templates&lt;/b&gt;, select &lt;i&gt;ASP.NET AJAX-Enabled Web Application&lt;/i&gt;. In the &lt;b&gt;Name&lt;/b&gt; field, type &lt;i&gt;CountryStateCityDropDownLists&lt;/i&gt;. Then press &lt;b&gt;OK&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Twf_xzYqK2OZA0p08wiZG9A_oxG1_pLJYh_3IZTvWeDDtyuLwFJxf56H15Y99ZB5QH4yAW2zOJ9B9UJ5Yk7N3bQfiGGeT6bcboiZRCUphxQubEbpl9Tk3zinFKeEcb7Im0ugLCdNJBo/s1600-h/createajaxenabledwebapplication1.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 226px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Twf_xzYqK2OZA0p08wiZG9A_oxG1_pLJYh_3IZTvWeDDtyuLwFJxf56H15Y99ZB5QH4yAW2zOJ9B9UJ5Yk7N3bQfiGGeT6bcboiZRCUphxQubEbpl9Tk3zinFKeEcb7Im0ugLCdNJBo/s320/createajaxenabledwebapplication1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376437553054755442&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Your project should now have been created successfully and you should see the Default.aspx like below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyZwbXQIaUQVdN7QP0Rc15bTAa0HAk_wfbMk9HOQtzEqTIxGBPNhZ5BKo6d9uF2_HI7BYvw5UGqP31Zr3jo-runyVufdrBRpk-UbRMri82-PUSAtzhZsvytFzIAJIbhD3bE_Ou0_I3ZKk/s1600-h/defaultaspx2.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 110px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyZwbXQIaUQVdN7QP0Rc15bTAa0HAk_wfbMk9HOQtzEqTIxGBPNhZ5BKo6d9uF2_HI7BYvw5UGqP31Zr3jo-runyVufdrBRpk-UbRMri82-PUSAtzhZsvytFzIAJIbhD3bE_Ou0_I3ZKk/s320/defaultaspx2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376441683113293634&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Take note of the &lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;times new roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;color:blue;&quot;   &gt;&lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);font-family:Verdana;font-size:8px;&quot;  &gt;asp&lt;/span&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;color:blue;&quot;   &gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);font-family:Verdana;font-size:8px;&quot;  &gt;ScriptManager&lt;/span&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;&quot;  &gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;ScriptManager1&quot;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; which is required to activate the ASP.NET AJAX and the Control Toolkit.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Integrate the AjaxControlToolkit library into your project&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;After the Page tag, add the following line:&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;times new roman&#39;;font-size:16px;&quot;  &gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;font-family:&#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;color:black;&quot;   &gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;color:blue;&quot;   &gt;@&lt;/span&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8px;&quot;  &gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;Register&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Assembly&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;AjaxControlToolkit&quot;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;Namespace&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;AjaxControlToolkit&quot;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:red;&quot;&gt;TagPrefix&lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;=&quot;ajaxToolkit&quot;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:black;&quot;&gt;%&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before we continue, copy and paste the AjaxControlToolkit.dll file from the Essentials section into the Bin folder of your application. Then right click on your project name in the &lt;b&gt;Solution Explorer&lt;/b&gt; and click on &lt;b&gt;Add Reference&lt;/b&gt;. Click on the &lt;b&gt;Browse&lt;/b&gt; tab and then look for the AjaxControlToolkit.dll file in the Bin folder of your application. Select it and then click &lt;b&gt;OK&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding the codes for the Countries, States and Cities drop down lists&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Next, we will add the codes for the 3 drop down lists which we will call &lt;i&gt;Countries&lt;/i&gt;, &lt;i&gt;States&lt;/i&gt; and &lt;i&gt;Cities&lt;/i&gt; like below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ8diB8aAro9Ptq6HETm7spBHVt5Uf5Ryx6hZtD7PrHfdRLF7_UdOGXPcMqPU3WgQzEYPLZJ6RHg602-v9SiwQCLnFM21z2cDAa_TIcLC2fPDMIFllCeszzXmh9l3Lwh2LNj_cZZ6h8YI/s1600-h/countriesstatescitiesdropdown3.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 236px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJ8diB8aAro9Ptq6HETm7spBHVt5Uf5Ryx6hZtD7PrHfdRLF7_UdOGXPcMqPU3WgQzEYPLZJ6RHg602-v9SiwQCLnFM21z2cDAa_TIcLC2fPDMIFllCeszzXmh9l3Lwh2LNj_cZZ6h8YI/s320/countriesstatescitiesdropdown3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376441687911161746&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Adding the codes for the CascadingDropDown extender&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Then, we add the &lt;b&gt;CascadingDropDown&lt;/b&gt; extender from the Control Toolkit for the 3 drop down lists.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgXdQ9Mi8cKITvmSNyx1WPjUh-6qMsJklC95DQHvd2JEjTjDTDLlzSYvehO0DKpHfOcn2DCHGQlfjuE4wMFoWDDk0uVOOyqb6CW7gFCsqxwSxnPRo4CtMwmup7fS11KjZ5gFnUmhSb1R0/s1600-h/cascadingdropdownextender4.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 211px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgXdQ9Mi8cKITvmSNyx1WPjUh-6qMsJklC95DQHvd2JEjTjDTDLlzSYvehO0DKpHfOcn2DCHGQlfjuE4wMFoWDDk0uVOOyqb6CW7gFCsqxwSxnPRo4CtMwmup7fS11KjZ5gFnUmhSb1R0/s320/cascadingdropdownextender4.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376441694895874018&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The extender will send an asynchronous request to a web service which will then return a list of entries to be displayed in the list. For this to work, the following &lt;b&gt;CascadingDropDown&lt;/b&gt; attributes need to be set:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;ServicePath&lt;/span&gt;: URL of a web service delivering the list entries&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;ServiceMethod&lt;/span&gt;: Web method delivering the list entries&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;TargetControlID&lt;/span&gt;: ID of the dropdown list&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Category&lt;/span&gt;: Category information that is submitted to the web method when called&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;PromptText&lt;/span&gt;: Text displayed when asynchronously loading list data from the server&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;As you can see, the Control Toolkit &lt;b&gt;CascadingDropDown&lt;/b&gt; extender has made it quite straightforward to enable interaction between a parent drop down list and its child drop down list. The next part is the web service that this extender will send a request to.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Creating the web service which the extender will query for information&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To add a web service, right-click on the project name, select &lt;b&gt;Add&lt;/b&gt; and then select &lt;b&gt;New Item&lt;/b&gt;. You should see the &lt;b&gt;Add New Item&lt;/b&gt; dialog box come up. Select &lt;b&gt;Web Service&lt;/b&gt; and in the &lt;b&gt;Name&lt;/b&gt; field, key in &lt;i&gt;CountryStateCity.asmx&lt;/i&gt; and then press &lt;b&gt;Add&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRCfVgAllwk8rOJeal4t_iLQkmVyZ-5StfZ05oJ-Y25NCV4asZ0z-43pKj3ANfm3dZG8W1ONgTXkvvRHwNJ5rphspJRepcS0tZE-pkvsu3sk1H1fBnaWRIqfSIWKWJO9qFTNloG18Z9Eg/s1600-h/addingwebservice5.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 193px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiRCfVgAllwk8rOJeal4t_iLQkmVyZ-5StfZ05oJ-Y25NCV4asZ0z-43pKj3ANfm3dZG8W1ONgTXkvvRHwNJ5rphspJRepcS0tZE-pkvsu3sk1H1fBnaWRIqfSIWKWJO9qFTNloG18Z9Eg/s320/addingwebservice5.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376441697999878194&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;You should now be able to see the codes for the CountryStateCity.asmx. Select all the codes and delete them.&lt;br /&gt;&lt;br /&gt;Now, add in the import statements like below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggQAmiceQjiXN80FmwnCZ5_G-wtoggy6rAEn1c0uK6Pf3Tv4Ol4eNCDPJiM74QmjbKOUGC5JUcEsQwMF0H_TKa4dHsqinA1tKS0qaKw_iZ8qpohSn7vUpkiKyxVWtPDUFB7qpHw0K-CzI/s1600-h/addingimportstatements6.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 282px; height: 123px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggQAmiceQjiXN80FmwnCZ5_G-wtoggy6rAEn1c0uK6Pf3Tv4Ol4eNCDPJiM74QmjbKOUGC5JUcEsQwMF0H_TKa4dHsqinA1tKS0qaKw_iZ8qpohSn7vUpkiKyxVWtPDUFB7qpHw0K-CzI/s320/addingimportstatements6.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376441709384961506&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Next, add the class called &lt;i&gt;CountryStateCity&lt;/i&gt; and also the database connection string.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkpehaaJheVKw5ACjHMfIS1Tam_6YOFxut292vZWO3JhHLHhU9vuoydZZuWQl85mWGLLvLN1d6sX29tX_VHxuDMY65vaT-2EYyejODiDAACaFHXob6CVH6n1JRN1TG_GNm32iVFNxEPrM/s1600-h/addingcountrystatecityclass7.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 45px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkpehaaJheVKw5ACjHMfIS1Tam_6YOFxut292vZWO3JhHLHhU9vuoydZZuWQl85mWGLLvLN1d6sX29tX_VHxuDMY65vaT-2EYyejODiDAACaFHXob6CVH6n1JRN1TG_GNm32iVFNxEPrM/s320/addingcountrystatecityclass7.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376443353907668882&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Database and table structures&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The database table that we are using is called &lt;i&gt;countrystatecity&lt;/i&gt; and the Microsoft SQL Server 2008 database is called &lt;i&gt;countrystatecitydb&lt;/i&gt;. The table structure is as follow:&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;times new roman&#39;;font-size:16px;&quot;  &gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;color:blue;&quot;   &gt;CREATE&lt;/span&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;TABLE&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;[dbo]&lt;span style=&quot;color:gray;&quot;&gt;.&lt;/span&gt;[countrystatecity]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [country_code] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;2&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [country_name] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;200&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [state] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;200&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [city_name] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;200&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [latitude] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;      [longitude] [nvarchar]&lt;span style=&quot;color:gray;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color:gray;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:gray;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;color:gray;&quot;   &gt;)&lt;/span&gt;&lt;span style=&quot;;font-family:&#39;Courier New&#39;;font-size:10px;&quot;  &gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;ON&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;[PRIMARY]&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Creating the web method which will populate the Countries drop down list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we are going to add the &lt;b&gt;GetCountries&lt;/b&gt; web method for the &lt;i&gt;CountryStateCity&lt;/i&gt; class. This web method will populate the Countries drop down list when the page loads.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3KQG0SZgfj6wJLH0qfjKXqUVOaH8jv_L-vl46dwdt6dc3-nko9rt72rZs_yeuj6jSxdDVHrv1_SfGov1hauQPDiZ0JFgUfdSObQH01Kmx33VYcIGV6rG09for6-GoI6l790L0MoCKKJs/s1600-h/addingwebmethodtcountriesdropdownlist8.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 62px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3KQG0SZgfj6wJLH0qfjKXqUVOaH8jv_L-vl46dwdt6dc3-nko9rt72rZs_yeuj6jSxdDVHrv1_SfGov1hauQPDiZ0JFgUfdSObQH01Kmx33VYcIGV6rG09for6-GoI6l790L0MoCKKJs/s320/addingwebmethodtcountriesdropdownlist8.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376443359784057122&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Note that the method needs to return an array of type CascadingDropDownNameValue (defined by the ASP.NET AJAX Control Toolkit). In the CascadingDropDownNameValue contructor, first the list entry’s text and then its value must be provided, just as NAME would do in HTML.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Creating the web method which will populate the States drop down list&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The next web method we add is the &lt;b&gt;GetStates&lt;/b&gt; web method which is called whenever the Countries drop down list changes.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP7WGJ1jza3fspUONyzkMIeBP0U5c5gjoavaS7kvkTdLZxJxtHuIFotER_wHJcI8svjhdu3SLji3d2BUEGaUcokhakrKeVxo8WyOMFBZVbbm1BBxnmEQBzeAxxKmNToS_-zSL47CYvgLA/s1600-h/addingwebmethodstatesdropdownlist9.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 122px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP7WGJ1jza3fspUONyzkMIeBP0U5c5gjoavaS7kvkTdLZxJxtHuIFotER_wHJcI8svjhdu3SLji3d2BUEGaUcokhakrKeVxo8WyOMFBZVbbm1BBxnmEQBzeAxxKmNToS_-zSL47CYvgLA/s320/addingwebmethodstatesdropdownlist9.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376443370843633394&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following code will check the list of selected values in the 3 drop down lists and puts them into a dictionary object:&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:&#39;times new roman&#39;;font-size:16px;&quot;  &gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8pt;color:blue;&quot;   &gt;Dim&lt;/span&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8pt;&quot;  &gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;kv&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color:blue;&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;StringDictionary = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;   style=&quot;margin: 0cm 0cm 0.0001pt;font-family:&#39;Times New Roman&#39;;font-size:12pt;&quot;&gt;&lt;span style=&quot;;font-family:Verdana;font-size:8pt;&quot;  &gt;CountryCode = Convert.ToString(kv(&lt;span style=&quot;color: rgb(163, 21, 21);&quot;&gt;&quot;Cat1&quot;&lt;/span&gt;))&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;Next, we just grab the value based on the Category that we set earlier which was Cat1 for the Countries drop down list. With this CountryCode, we can get a list of matching States which we return in an array of CascadingDropDownNameValue.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Creating the web method which will populate the Cities drop down list&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The last web method is the &lt;b&gt;GetCities&lt;/b&gt; web method which is triggered whenever the States drop down list changes.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfjD0dn8hT933FSE8a-YeQ_EjxJOJNs9prWq0Kv90sNzwlrkWa3uTSO4muvjPcvKs755fNy4HYqP1b-a3Rq2wcU_lDarnLc5KTW7KpmYphIy2V3x2gHFtqBA3dP8RtiypPkX6i70yDIs/s1600-h/addingwebmethodcitiesdropdownlist10.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 146px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgAfjD0dn8hT933FSE8a-YeQ_EjxJOJNs9prWq0Kv90sNzwlrkWa3uTSO4muvjPcvKs755fNy4HYqP1b-a3Rq2wcU_lDarnLc5KTW7KpmYphIy2V3x2gHFtqBA3dP8RtiypPkX6i70yDIs/s320/addingwebmethodcitiesdropdownlist10.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5376443372565428450&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This web method works similar to the last one by getting the value of the parent drop down lists and then getting a list of matching Cities.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Downloading the codes and live demo&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can download the ZIP file containing the codes &lt;a href=&quot;http://www.geodatasource.com/blogfiles/CascadingDropDownListsinNetandAJAXSampleCode.zip&quot;&gt;here&lt;/a&gt;. For the data and a live demo of the drop down lists, you can visit the &lt;a href=&quot;http://www.geodatasource.com/world-major-cities.html?rid=207&quot; target=&quot;_blank&quot;&gt;GeoDataSource World Major Cities&lt;/a&gt; package page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://geodatasource.blogspot.com/2009/09/rapidly-develop-and-deploy.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VzlJ0vuVWbVb09RlBMMGAGxfydQSEUxfrxh-6hyZzMWE5UzOgL_tmHbo9yBobCxLd11Tv5yuIwI2pYrYkSz2e_t6-nAYbtGvkRdy3gv3YOtlEVJXnxfk4U5_0c2f5zpSZlYD0qWkfrU/s72-c/citiesmajor.gif" height="72" width="72"/></item></channel></rss>