Search code examples
c#htmlajaxcontroltoolkit

AjaxControlToolkit AutoCompleteExtender List Not Showing in Google Chrome


Using the below code i am successfully able to show auto complete list on text box in Firefox and IE but its not showing in google chrome please help me. the data from the database is being retrieved successfully. i debugged it and there are no errors.

   <style  type="text/css">


.AutoExtender 
{ 
    font-size: 12px; 
    color: #000; 
    padding: 3px 5px; 
    border: 1px solid #999; 
    background: #fff; 
    width: auto; 
    float: left; 
    z-index: 9999999999; 
    position:absolute; 
    margin-left:0px; 
    list-style: none; 
    font-weight: bold; 
} 
        .listItem {
        color: #191919;

        } 
        .itemHighlighted {
        background-color: #ADD6FF;       
        }
</style>


<asp:TextBox ID="TextBox1" placeholder="SELECT * FROM TABLEA" class="enjoy-css" runat="server"  autocomplete="off"  TextMode="multiline"> 
             </asp:TextBox>

      <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>


    <AjaxControlToolkit:AutoCompleteExtender 
    runat="server" 
    ID="AutoCompleteExtender1" 
    BehaviorID="AutoCompleteExtender1"
    TargetControlID="TextBox1"
    ServiceMethod="AutoCompleteAjaxRequest"
    ServicePath="AutoComplete.asmx"
    MinimumPrefixLength="3" 
    CompletionInterval="100"
    EnableCaching="true"
    CompletionSetCount="100" 
    CompletionListCssClass="AutoExtender"
    CompletionListItemCssClass="listItem"
    FirstRowSelected="true"
    CompletionListHighlightedItemCssClass="itemHighlighted"
    DelimiterCharacters=";, :\n\r"
    showonlycurrentwordincompletionlistitem="true"
    >
</AjaxControlToolkit:AutoCompleteExtender>

Autocomplete web service

    public string[] AutoCompleteAjaxRequest(string prefixText, int count)
    {
        Match match;

        match = Regex.Match(prefixText, "(\\w+)$");


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

        if (match.Success)
        {

            String Query = "SELECT TABLE_NAME FROM(select TABLE_NAME from INFORMATION_SCHEMA.COLUMNS  UNION select COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS ) COLUMN_NAME WHERE TABLE_NAME like '%" +match.Value+"%';";
            DataTable dt = this.GetData(Query, CreateConnectionString(UserName, Password, DatabaseName, DataSource));
            if (dt.Rows.Count > 0)
            {
                int countt = dt.Rows.Count;

                for (int i = 0; i < countt; i++)
                {
                    ajaxDataCollection.Add(dt.Rows[i]["TABLE_NAME"].ToString());
                }
            }

                ajaxDataCollection.Add("SELECT");
                ajaxDataCollection.Add("WHERE");
                ajaxDataCollection.Add("UPDATE");
                ajaxDataCollection.Add("INSERT");
                ajaxDataCollection.Add("DELETE");
                ajaxDataCollection.Add("EXEC");
                ajaxDataCollection.Add("FROM");
                ajaxDataCollection.Add("VALUES");
                ajaxDataCollection.Add("HAVING");

            return  ajaxDataCollection.ToArray();
        }

Solution

  • i removed the AjaxControlToolKit dll file and installed it again using Nuget and it worked... i guess something went wrong when downloading/referencing the previous dll file.