Urgent---- AutoComplete Extender is not working properly

Posted by Ujjal under ASP.NET AJAX on 4/12/2012 | Points: 10 | Views : 3657 | Status : [Member] | Replies : 8
Hi,

Auto Complete extender is not working properly in visual studio 2005.I am using the following code :-

<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtentername" MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="10" CompletionInterval="100" ServiceMethod="GetCountries">
</cc1:AutoCompleteExtender>


Below is the code for code behind section :-

[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static List<string> GetCountries(string prefixText)
{

SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["Thyrocare"]);
SqlCommand cm;

if (con.State == ConnectionState.Closed)
{
con.Open();
}

cm = new SqlCommand(" select * from Patientdetails where Patientname like @Name+'%'", con);
cm.Parameters.AddWithValue("@Name", prefixText);
SqlDataAdapter da = new SqlDataAdapter(cm);
DataTable dt = new DataTable();
da.Fill(dt);
List<string> CountryNames = new List<string>();
for (int i = 0; i < dt.Rows.Count; i++)
{
CountryNames.Add(dt.Rows[i][1].ToString());
}
return CountryNames;


}


I am not getting any kind of error though the list is not coming in the textbox.
Kindly share your ideas regarding the same.




Responses

Posted by: Mani5155 on: 4/12/2012 [Member] Starter | Points: 25

Up
0
Down
put break point in web service debug it if any error in web service you can easily identify it if the break point not executed problem in your ajax extender only

Top Forums Authors
Thu, 22-May-2025 Authors
All Time Authors
Jayakumars
7860
Karthikanbarasan
3455
Oswaldlily
3340

Latest members | More ...


(Statistics delayed by 5 minutes)
Advertisements