954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

auto complete extender is not working in Web user Control

hi

I am using auto complete extender and it is not working in Web user Control . But Working in Web form Please give its solution ASAP.

Cs Code

[System.Web.Services.WebMethod]
    public static string[] GetSuggestions(string prefixText, int count)
    {
        MyDatabaseDataContext db = new MyDatabaseDataContext();
        return db.Movies
            .Where( m => m.Title.StartsWith(prefixText) )
            .OrderBy( m => m.Title )
            .Select( m => m.Title)
            .Take(count)
            .ToArray();
    }


<asp:TextBox  id="txtMovieTitle"  AutoComplete="off"  Runat="server" />
    <ajax:AutoCompleteExtender   id="ace1"
        TargetControlID="txtMovieTitle"
        ServiceMethod="GetSuggestions"
        MinimumPrefixLength="1"
        runat="server" />

Thanx

sbglobal
Light Poster
25 posts since Aug 2010
Reputation Points: 7
Solved Threads: 0
 

Hi,

The AutoCompleteExtender may not work within a UserControl due to its limitations. Refer the following link for more details.

Hot to: user AutoCompleteExtender in a UserControl (ascx) and place the ServiceMethod on its code-behind.

You can try to use jQuery.

Ramesh S
Posting Pro
583 posts since Jun 2009
Reputation Points: 165
Solved Threads: 113
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: