Click here to Skip to main content
16,005,682 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

Please help, i have taken ajax autocomplete extender in my project.
I have written a method in my aspx code behind but that method is not getting called. Please help!!!

Thankyou.
Posted
Comments
thatraja 24-Dec-10 7:17am    
show your code

Go through the below link..,
Here[^]
 
Share this answer
 
XML
I would start from creating similar example as given here:
<a href="http://www.asp.net/ajax/ajaxcontroltoolkit/samples/">http://www.asp.net/ajax/ajaxcontroltoolkit/samples/</a>
 
Share this answer
 
Try to make your Web method at Default.aspx.cs rather than in different asmx file and remove
C++
ServicePath="AutoComplete.asmx"

From your code

at CS page

[System.web.Webservices.WebMethod]
C++
public string[] GetCountriesList(string prefixText)

   {

       DataSet dtst = new DataSet();

       SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["ConnectionString"]);

       string strSql = "SELECT CountryName FROM Tbl_Countries WHERE CountryName LIKE '" + prefixText + "%' ";

       SqlCommand sqlComd = new SqlCommand(strSql, sqlCon);

       sqlCon.Open();

       SqlDataAdapter sqlAdpt = new SqlDataAdapter();

       sqlAdpt.SelectCommand = sqlComd;

       sqlAdpt.Fill(dtst);

       string[] cntName = new string[dtst.Tables[0].Rows.Count];

       int i = 0;

       try

       {

           foreach (DataRow rdr in dtst.Tables[0].Rows)

           {

               cntName.SetValue(rdr["CountryName"].ToString(), i);

               i++;

           }

       }

       catch { }

       finally

       {

           sqlCon.Close();

       }

       return cntName;

   }


I Hope It will work
 
Share this answer
 
We can't help anything until and unless you provide code.

Take a look at THIS[^] article this may help you.

Please vote and Accept Answer if it Helped.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900