Last post Nov 06, 2014 05:20 AM by Jayesh.Dalvi
Nov 05, 2014 02:53 AM|Jayesh.Dalvi|LINK
I am populating Autocomplete data in textbox with states name in India by using below web service code:
public static string GetNames(string prefixText, int count)
NamesDataContext db = new NamesDataContext();
return db.StateAndCityMasters.Where(n => n.state.StartsWith(prefixText)).OrderBy(n => n.state).Select(n => n.state).Take(count).ToArray();
Also in design file as below :
<ajaxToolkit:AutoCompleteExtender ID="txtName_AutoCompleteExtender" runat="server"
TargetControlID="statecombo" MinimumPrefixLength="1" ServiceMethod="GetNames">
<asp:TextBox ID="statecombo" runat="server" AutoComplete="Off" CssClass="txtfld3" Font-Size="Large" ></asp:TextBox>
I want to populate cities in indian states after typing State name in the state textbox .
Now my problem is in which event i should write code to get cities in States in India to populate cities drop down list .
Please help me to select specific event where i can populate cities in city drop down list.
Nov 05, 2014 10:42 PM|chetan.sarode|LINK
Refer this -
Nov 06, 2014 12:23 AM|Kevin Shen - MSFT|LINK
Based on my understanding ,When use Autocomplete data in textbox, when you type something ,it will show related value for you.
While in your post ,you need to type state name in your textbox,then show related cities in your own dropdownlist,
I suggest that you can set two dropdownlist controls in your project ,one is for your state,one is for city.
When you select the state ,then it will select related cities for your another dropdownlist control.
Nov 06, 2014 05:20 AM|Jayesh.Dalvi|LINK
Dear chetan.sarod,Kevin Shen
Thanks for yours kind reply.
Your reply helped me to enhance my knowledge.