Click here to Skip to main content
15,879,095 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

i have textbox where i want to add autocompeleteExtender.

for which i wrote webservice as guided.

my webservice code:
[System.Web.Services.WebMethod]
    [System.Web.Script.Services.ScriptMethod()]
    
    public List<string> GetCompletionList(string prefixText)
    {
        SqlParameter[] p = new SqlParameter[1];
        p[0] = new SqlParameter("@data", prefixText);
        DataTable dt = dl.GetDataWithParameters("Sp_GetPriceRef_ddl1", p);

        List<string> items = new List<string>();

        foreach(DataRow dr in dt.Rows)
        {
            string strName = dr["OldRef"].ToString();
            items.Add(strName);
        }
        return items;
    }


I have invoked the method of webservices, its working. but its got getting in the textbox.

asp.net
 <asp:TextBox ID="txtpRef" Width="100px" runat="server" ></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1"  runat="server"
 CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20" TargetControlID="txtpRef" MinimumPrefixLength="1" ServiceMethod="GetCompletionList" ServicePath="WebService.asmx" ShowOnlyCurrentWordInCompletionListItem="true" DelimiterCharacters=";, :">
</ajaxToolkit:AutoCompleteExtender>


but, i'm not getting this autocompelete.

Can any one plzzzz help me.


Thanks
Posted
Updated 11-Oct-14 5:27am
v3

1 solution

XML
Add Script Manager in your page.


<asp:ScriptManager runat="server" />
 
Share this answer
 
Comments
abdul subhan mohammed 13-Oct-14 10:16am    
i have already added toolscriptmanager
Mukesh Ghosh 14-Oct-14 1:37am    
Is it hitting your service, can you check after debug? It seems service path mismatch

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