Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

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

$
0
0

Hi All,

I am populating Autocomplete data in textbox with states name in India by using below web service code:

 [System.Web.Services.WebMethod]
    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 :

<td><ajaxToolkit:AutoCompleteExtender ID="txtName_AutoCompleteExtender" runat="server"
                TargetControlID="statecombo" MinimumPrefixLength="1" ServiceMethod="GetNames"></ajaxToolkit:AutoCompleteExtender></br><asp:TextBox ID="statecombo" runat="server" AutoComplete="Off"  CssClass="txtfld3" Font-Size="Large"  ></asp:TextBox></td>

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.

Regards,

Jayesh.(From India,Mumbai)


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>