Please Help me to select event for getting cities in INDIA after calling web service for states in INDIA. RRS feed

  • Question

  • User-1868929400 posted

    Hi All,

    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.


    Jayesh.(From India,Mumbai)

    Wednesday, November 5, 2014 2:53 AM


All replies