locked
Autocomplete Demonstration Issue- Not replacing full text RRS feed

  • Question

  • User-740766282 posted

    Hi

    I have used Autocomplete extender to search records in my ecommerce website.

    When I select a record from recommended list of results, it does not replaces complete text in search bar. It only replaces the last word.

    For Example : if i type Dell Vostro and i choose a result from recommended list of results (Dell Vostro 520), it replaces only "Vostro" and gives Dell Dell Vostro 520.

    How to replace full text. I am using the same code as provided in the sample toolkit.

    Saturday, February 1, 2014 1:44 AM

All replies

  • User-492460945 posted

    Hi,

    I have faced different issues when tried to use AJAX AutoCompleteExtender.So I've gone to jQuery to achieve this perfectly..

      var dsCities = <%=listFilterCities %>;
                $("#txtCities").autocomplete({
                    source: dsCities
                });

    in page load

    listFilterCities = BindName();
        private string BindCities()
        {
            DataTable dt = SearchCity(string.Empty);
    
            StringBuilder output = new StringBuilder();
            output.Append("[");
            for (int i = 0; i < dt.Rows.Count; ++i)
            {
                output.Append("\"" + dt.Rows[i]["City"].ToString() + "\"");
    
                if (i != (dt.Rows.Count - 1))
                {
                    output.Append(",");
                }
            }
            output.Append("];");
            return output.ToString();
        }
    


    Hope this helps..

    Saturday, February 1, 2014 3:00 AM
  • User-503402950 posted

    Autocomplete Demonstration Issue- Not replacing full text

    @Chandan777:: Here's a sample solution for ajaxautocomplete, it is replacing the textbox with the whole selected text, you can get it here;

    http://deepasp.wordpress.com/2013/05/14/ajax-autocomplete-crossbrowser-compatiblity/

    Saturday, February 1, 2014 11:25 AM
  • User-417640953 posted

    For Example : if i type Dell Vostro and i choose a result from recommended list of results (Dell Vostro 520), it replaces only "Vostro" and gives Dell Dell Vostro 520.

    Hi chandan777,

    Thank you post the issue to this forum.

    Sorry to say that I cannot reproduce your scenes, have you try below example.

    http://www.asp.net/ajaxlibrary/ajaxcontroltoolkitsamplesite/autocomplete/autocomplete.aspx

    If you still cannot solve it, please share your code and let us reproduce your scenes.

    Thanks.

    Best Regards!

    Monday, February 10, 2014 4:35 AM