Hi,
I am working with Ajax Autocompleteextender.
It is not displaying the names .
Below is the sample code.
.cs
- [System.Web.Script.Services.ScriptMethod()]
- [System.Web.Services.WebMethod]
- public static List<string> Getfirstname(string prefixText)
- {
- string strFilter = string.Empty;
- DataSet ds = new DataSet();
- System.Data.DataTable dt = new System.Data.DataTable();
- es_CustomersDAL ObjCustomersDAL = new es_CustomersDAL();
- ds = ObjCustomersDAL.GetCustomers();
-
- System.Data.DataView dv = ds.Tables[0].DefaultView;
- strFilter += "ES_CustomerName LIKE '" + prefixText + "%'";
- dv.RowFilter = strFilter;
- dt = dv.ToTable();
- List<string> GetCustomerName = new List<string>();
- for (int i = 0; i < dv.Count; i++)
- {
- GetCustomerName.Add(dt.Rows[i]["ES_CustomerName"].ToString());
- }
- return GetCustomerName;
- }
.aspx
- <tr>
- <td>
- </td>
- <td width="17%" >
- First / Company Name
- </td>
- <td width="32%" >
- <%--<asp:UpdatePanel ID="_udpCompanyName" runat="server">
- <ContentTemplate>--%>
- <asp:TextBox TabIndex="6" ID="txtfirstname" placeholder="Full Name of Comapany" runat="server" class="input ui-tooltip" MaxLength="110" title="Please enter slowely name."></asp:TextBox>
- <asp:AutoCompleteExtender ID="auto1" runat="server" TargetControlID="txtfirstname" MinimumPrefixLength="1" EnableCaching="false" CompletionSetCount="1" CompletionInterval="100" ServiceMethod="Getfirstname"></asp:AutoCompleteExtender>
- <%-- <asp:AutoCompleteExtender ID="AutoComptxtfirstname" runat="server" TargetControlID="txtfirstname" MinimumPrefixLength="1" EnableCaching="true" CompletionSetCount="1" CompletionInterval="100"
- ServiceMethod="Getfirstname" >
- </asp:AutoCompleteExtender>--%>
- <span class="mandatoryfield">* </span><%--</ContentTemplate>
- </asp:UpdatePanel>
- --%>
- </td>
- <td width="13%" >
- Last Name
- </td>
- <td width="38%" >
- <asp:TextBox TabIndex="7" ID="txtlastname" runat="server" class="input" MaxLength="110"></asp:TextBox>
- </td>
- </tr>