title: AJAX AutocompleteExtender isn't working. Web Service works
body: <p>This is c# .net 2.0. I am using a masterpage.</p>
  
  <ul>
  <li>The WebService works fine on its own.</li>
  <li>I am completely stumped. When I type in the TextBox, nothing happens.</li>
  </ul>
  
  <p>Files:</p>
  
  <p>EditTicket.aspx
  AutoComplete.asmx
  App_Code/AutoComplete.cs</p>
  
  <p>EditTicket.aspx:</p>
  
  <pre><code>        &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %&gt;
  
  
          &lt;asp:ScriptManager id="ScriptManager1" runat="server" EnablepageMethods="true"&gt;
          &lt;Services&gt;
              &lt;asp:ServiceReference Path="AutoComplete.asmx" /&gt;
          &lt;/Services&gt;
          &lt;/asp:ScriptManager&gt;
  
      &lt;cc2:AutoCompleteExtender
           runat="server" 
           ID="AutoCompleteExtender1" 
           ServicePath="AutoComplete.asmx" 
           ServiceMethod="AutoComplete2" 
           MinimumPrefixLength="1" 
           CompletionSetCount="12" 
           TargetControlID="TextBox3" 
           EnableCaching="True" &gt;
       &lt;/cc2:AutoCompleteExtender&gt;
  
  &lt;asp:TextBox ID="TextBox3" runat="server"&gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>AutoComplete.asmx:</p>
  
  <pre><code>&lt;%@ WebService Language="C#" CodeBehind="~/App_Code/AutoComplete.cs" Class="AutoComplete" %&gt;
  </code></pre>
  
  <p>AutoComplete.cs:</p>
  
  <pre><code>using System;
  using System.Web;
  using System.Collections;
  using System.Web.Services;
  using System.Web.Script.Services;
  using System.Web.Services.Protocols;
  using System.Collections.Generic;
  using System.Data.SqlClient;
  using System.Configuration;
  using System.Data;
  
  
  /// &lt;summary&gt;
  /// Summary description for AutoComplete
  /// &lt;/summary&gt;
  [WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  [ScriptService]
  public class AutoComplete : System.Web.Services.WebService {
  
      public AutoComplete () {
  
          //Uncomment the following line if using designed components 
          //InitializeComponent(); 
      }
  
      [WebMethod]
      [ScriptMethod]
      public string[] AutoComplete2(string prefixText,int count)
      {
          string conString = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
          SqlConnection connection = new SqlConnection(conString);
          connection.Open();
          SqlParameter prm;
          string sql = "Select program_name FROM CM_Programs WHERE program_name LIKE @prefixText";
          SqlDataAdapter cmd = new SqlDataAdapter(sql, connection);
          prm = new SqlParameter("@prefixText", SqlDbType.VarChar, 50);
          prm.Value = prefixText+ "%";
          cmd.SelectCommand.Parameters.Add(prm);
          DataTable dt = new DataTable();
          cmd.Fill(dt);
          string[] items = new string[dt.Rows.Count];
          int i = 0;
          foreach (DataRow dr in dt.Rows)
          {
              items.SetValue(dr["program_name"].ToString(),i);
              i++;
          }
          connection.Close();
          return items;
      } 
  }
  </code></pre>