Click here to Skip to main content
15,885,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
ASP.NET
<asp:TextBox ID="txtName" runat="server" Height="18px" Width="366px" 
            AutoPostBack="True" ></asp:TextBox>
        
<ajaxToolkit:AutoCompleteExtender
   runat="server" ID="autoComplete1"  TargetControlID="txtName"
ServicePath="WebService1.asmx" ServiceMethod="GetCompletionList"
 MinimumPrefixLength="1" />


its not working for me..
i have tried everything..
C#
[WebMethod, ScriptMethod]
        public static string[] GetCompletionList(string prefixText, int count)
        {
            if (count == 0)
        {
            count = 10;
        }
 
        if (prefixText.Equals("xyz"))
        {
            return new string[0];
        }
 
        Random random = new Random();
        List<string> items = new List<string>(count);
        for (int i = 0; i < count; i++)
        {
            char c1 = (char)random.Next(65, 90);
            char c2 = (char)random.Next(97, 122);
            char c3 = (char)random.Next(97, 122);
 
            items.Add(prefixText + c1 + c2 + c3);
        }
 
        return items.ToArray();
    
        }
Posted

you Can check with attribute in web service [System.Web.Script.Services.ScriptService].Web Service to be called from script, using ASP.NET AJAX
 
Share this answer
 
thanks but i already checked that also..
 
Share this answer
 
go thru the link for further clarification..

http://forums.asp.net/t/1140406.aspx/1
 
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